[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tagged string builder
From: |
Keisuke Nishida |
Subject: |
Re: tagged string builder |
Date: |
Sun, 25 Mar 2001 13:01:24 -0500 |
User-agent: |
Wanderlust/2.4.0 (Rio) SEMI/1.13.7 (Awazu) FLIM/1.13.2 (Kasanui) Emacs/21.0.99 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) |
At 25 Mar 2001 04:18:24 +0200,
Marius Vollmer wrote:
>
> > This is a simple tagged string builder:
> >
> > guile> (display #[html #[head #[title title ] ]
> > #[body #[a #:href url title ] ] ] )
> > <html><head><title>Guile Home Page<\title>
>
> First thought: why not use `#<' as the hash sequence?
I first thought about it, but it conflicts with outputs of
non-readable objects (i.e., #<smob xxx> etc.).
I think my second format is better because you can safely
close a block by ')'. ##(title title) is okay, but
#<title title> is an error because the reader considers
`title>' to be a single symbol.
By the way, is it a good idea to rewrite Guile's web pages
using this notation? I generate my personal pages like this:
(define title "My page")
(define menu
'(("Links"
("GNU" "http://www.gnu.org/")
("Guile" "http://www.gnu.org/software/guile/"))))
(define (menu->html menu)
...)
(define main-page
(string-append
##(h1 title)
##(p "Hello")
))
(define page
##(html ##(head ##(title title))
##(body ##(table ##(tr ##(td (menu->html menu))
##(td main-page))))))
(display page)
Kei