Subject: Re: What is the main advantage of macros over functions?
From: rpw3@rpw3.org (Rob Warnock)
Date: Fri, 06 Jan 2006 07:19:34 -0600
Newsgroups: comp.lang.lisp
Message-ID: <PJadnYjBstn78yPeRVn-rg@speakeasy.net>
Tiarn�n � Corr�in <ocorrain@yahoo.com> wrote:
+---------------
| rpw3@rpw3.org (Rob Warnock) writes:
| > Yes. Take a look at, say, HTOUT <http://www.cliki.net/htout> or
| > CL-WHO <http://www.cliki.net/CL-WHO>, both of which let you write
| > things like this:
| > (let ((title "Simple Test Page"))
| >   (with-html-output (s *standard-output*)
| > 	(:html
| > 	  (:head (:title title)) (lfd)
...
| 
| And indeed, you can do something like:
| (defmacro with-standard-page ((title &key (stylesheet "standard.css"))
|                               &body body)
+---------------

And indeed, when I'm actually doing a web site with it [as opposed
to a quicky c.l.lisp "why use macros" example], I do things like that,
of course. I have macros & functions with names like these:

    results-template-page
    sql-error-page
    emit-top-toolbar
    emit-addnew-button
    decode-image-button-name
    build-continuation		; for multi-step form dialogs
    emit-editbox-list
    make-mailto-link

and so on...


-Rob

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