From: David Bakhash
Subject: Re: Writing HTML (#'format and string interpolation)
Date:
Message-ID: <cxjiu7855wv.fsf@acs5.bu.edu>
wow. Just for me :-)
looks real nice.
dave
From: Christopher R. Barry
Subject: Re: Writing HTML (#'format and string interpolation)
Date:
Message-ID: <87673727l2.fsf@2xtreme.net>
Paul Foley <···@below> writes:
> I wrote the following in response to David Bakhash's request for
> something better than FORMAT for producing HTML.
>
> Example:
>
> (html (:stream output-stream)
> (head ()
> (title () "HTML production example"))
> (body ()
> (h1 (:align :center) "A table")
> (table (:border t)
> (tr ()
> (th () "Column 1")
> (th () "Column 2")
> (th () "Column 3"))
> (dolist (row '((1 "two" 3) (4 5 6) (7 8 9)))
> (tr ()
> (td () (princ (first row)) nil)
> (td () (princ (second row)) nil)
> (td () (princ (third row)) nil))))))
In <················@naggum.no>[1] Erik Naggum wrote:
so if we allow the same kind of pun on name spaces as Common Lisp already
uses in (foo bar) where FOO is in the function namespace and bar is in the
value namespace, my suggestion is ((foo :bar 1) "zot"), which I think is a
clear winner over the runner-up (foo (:bar 1) "zot") for the simple reason
that you can view (foo :bar 1) as a function call that returns a function
that can deal with the contents. experienced Lisp or Scheme programmers
may think of this as "currying".
Christopher
1. http://x35.deja.com/[ST_rn=ps]/getdoc.xp?AN=491129293&CONTEXT=932973014.768671902&hitnum=4
From: ········@cc.hut.fi
Subject: Re: Writing HTML (#'format and string interpolation)
Date:
Message-ID: <m36737s4xq.fsf@mu.tky.hut.fi>
> In <················@naggum.no>[1] Erik Naggum wrote:
>
> so if we allow the same kind of pun on name spaces as Common Lisp already
> uses in (foo bar) where FOO is in the function namespace and bar is in the
> value namespace, my suggestion is ((foo :bar 1) "zot"), which I think is a
> clear winner over the runner-up (foo (:bar 1) "zot") for the simple reason
> that you can view (foo :bar 1) as a function call that returns a function
> that can deal with the contents. experienced Lisp or Scheme programmers
> may think of this as "currying".
My personal favourite is (foo :bar 1 "zot") which can be seen as a
simple function call with keyword and &rest arguments.
Hannu Rummukainen
From: Gareth McCaughan
Subject: Re: Writing HTML (#'format and string interpolation)
Date:
Message-ID: <86vhb7ox53.fsf@g.local>
········@cc.hut.fi writes:
> My personal favourite is (foo :bar 1 "zot") which can be seen as a
> simple function call with keyword and &rest arguments.
Unfortunately you have to parse them yourself, since &key and &rest
don't mix in the way you'd want them to for this purpose.
--
Gareth McCaughan ················@pobox.com
sig under construction
From: ········@cc.hut.fi
Subject: Re: Writing HTML (#'format and string interpolation)
Date:
Message-ID: <m34sipsyez.fsf@mu.tky.hut.fi>
Gareth McCaughan <················@pobox.com> writes:
> > My personal favourite is (foo :bar 1 "zot") which can be seen as a
> > simple function call with keyword and &rest arguments.
>
> Unfortunately you have to parse them yourself, since &key and &rest
> don't mix in the way you'd want them to for this purpose.
Of course, but it doesn't matter on the caller side and makes for less
cluttered presentation.
Hannu Rummukainen
From: David Bakhash
Subject: Re: Writing HTML (#'format and string interpolation)
Date:
Message-ID: <cxjhfmq69zi.fsf@acs5.bu.edu>
what Foley did is done the right way. It should not change in the says that
have been suggested.
Just look at with-open-file and friends. a () after tags is not a problem,
and later on, and visually, it helps a lot t separate optional fields from the
body, which is the string inside the tag.
that's my vote.
dave