Subject: Re: macro and cl-who help
From: (Rob Warnock)
Date: Thu, 14 May 2009 05:49:44 -0500
Newsgroups: comp.lang.lisp
Message-ID: <>
Alessio Stalla  <> 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 Warnock			<>
627 26th Avenue			<URL:>
San Mateo, CA 94403		(650)572-2607