Marco Antoniotti
8/12/2015 7:42:00 AM
On Wednesday, August 12, 2015 at 8:59:24 AM UTC+3, Frank DG1SBG wrote:
> "Pascal J. Bourguignon" <pjb@informatimago.com> writes:
>
> > CAI GENGYANG <gengyangcai@gmail.com> writes:
> >
> >> I want to create a text box on a page that says "Lisp is a powerful
> >> language". It should look like this :
> >>
> >> ----------------------------------
> >> | |
> >> | Lisp is a powerful language |
> >> | |
> >> | |
> >> ----------------------------------
>
> At this point I thought: "Oh no - she still didn't get it!"
>
>
> > cl-user> (let ((message "Lisp is a powerful language"))
> > (format t "+--~V,,,'-<~>--+~%~:*| ~V<~> |~%| ~A |~%~0@*| ~V<~> |~%~:*| ~V<~> |~%~:*+--~V,,,'-<~>--+~%"
> > (length message) message))
> > +-------------------------------+
> > | |
> > | Lisp is a powerful language |
> > | |
> > | |
> > +-------------------------------+
> > nil
> > cl-user>
> >
> > Oops, sorry, there's a bug here.
> >
> >
> > There you go:
> >
> > cl-user> (let ((message "Lisp is a powerful language"))
> > (format t "----~V,,,'-<~>---~%~:*| ~V<~> |~%| ~A |~%~0@*| ~V<~> |~%~:*| ~V<~> |~%~:*----~V,,,'-<~>---~%"
> > (length message) message))
> > ----------------------------------
> > | |
> > | Lisp is a powerful language |
> > | |
> > | |
> > ----------------------------------
> > nil
> > cl-user>
>
> At this point I had to explain to my wife why on earth I'm screaming
> laughing...
>
> Logged here as a classic "I can't describe what I want but I get it
> exactly that way" - or why real consultants don't deliver what the
> client wants but what the client needs.
>
> +1, too, for the use of format to solve this puzzle!
>
> ;; Frank
Ok, guys. You had your fun :)
In Lispworks
(capi:display-message "Lisp is such a powerful language")
or
(capi:contain (make-instance :text "Lisp is such a powerful language"))
Or
(with-open-file (f "index.html" :direction :output)
(<:with-html-syntax-output (f :print-pretty t)
(<:document ()
(<:h1 () "Lisp")
(<:p () "... is such a pretty tasty soup of toenails clippings!")))
Of course... using the XHTMLambda library :)
Cheers
--
MA