Subject: Re: macro and cl-who help
From: rpw3@rpw3.org (Rob Warnock)
Date: Thu, 14 May 2009 05:49:44 -0500
Newsgroups: comp.lang.lisp
Message-ID: <6LKdnaSCBaDVapbXnZ2dnUVZ_qGdnZ2d@speakeasy.net>
Alessio Stalla  <alessiostalla@gmail.com> wrote:
+---------------
| Right, my cl-who was dusty :) thanks for pointing it out. I wonder why
| it is designed that way... wouldn't it have been more "Lispy" to use
| macros for html tags instead of writing a custom "evaluator/compiler"
| that just treats keywords differently? E.g.
| 
| (html
|   (body
|     (p (:style "xxx") ".....")))
| 
| This would have been extensible with user-defined tags, and would have
| avoided htm and friends. But maybe there's a drawback I fail to see...
+---------------

You can do as you suggest (I believe HTMLGEN does, in fact),
but then you have to worry about namespace collisions between
HTML tags and your macros/functions. You [or your HTML-generating
library] also have to explicitly predefine a macro for every
possible HTML tag you might ever want to emit.

Whereas although HTOUT & CL-WHO do require you to "switch namespaces"
semi-manually with HTM, there's no collision between HTML tags and your
macros/functions, since one normally never defines a macro or function
in the keyword package. Yes, it's a hack, but a convenient one.


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607