Rainer Joswig <email@example.com> wrote:
| <firstname.lastname@example.org> in m2k6debzm1.fsf@Cascade.local:
| > email@example.com (Rob Warnock) writes:
| >> (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)
| Why would you write it as a macro? This has only disadvantages.
| That's exactly the place where I would NOT use macros. Where macros even
| are EVIL.
| I'm using functions for it.
| (defun generate-benchmark-page (url stream)
| url stream
| :render-function (lambda (url stream)
| (declare (ignore url))
| (list *benchmark-values* *benchmark1-values*
| *benchmark2-values* *benchmark3-values*
| :table-type :horizontal))
| :title "Rainer Joswig's Home, Lisp Benchmarks"))
O.k., you caught me. I don't actually use macros for "wrapper" pages
either. The RESULTS-TEMPLATE-PAGE I mentioned in an earlier reply is
actually a function, that takes a LAMBDA or oter function as a callback.
You're right, such functions are less code-wasteful, and easier to
But WITH-HTML-OUTPUT... that one *should* be a macro!
Rob Warnock <firstname.lastname@example.org>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607