[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A Conclusion Re: SchemeQL
MJ Ray wrote:
> I must say that I'm amazed. I think I've just seen my first post ever
> where Shriram is posting something I vehemently and violently disagree
> with.
Hmm, I'm losing my edge. Must be old age. (-:
> Expecting templates to be written in scheme is totally
> wrong-headed. The designers just won't go for it.
Oh, but the templates are only barely written in Scheme. As Noel
points out, they're largely written in a simplified XML syntax. Think
of it as a two-colored syntax, where (lacking color) upper-case
represents one color and lower-case another:
(define (template TITLE)
`(html
(head
(title ,TITLE))
(body
"Some body text")))
This is almost the same as writing
(define (template TITLE)
<html>
<head>
<title>TITLE</title>
</head>
<body>
Some body text
</body>
</head>
)
So let's make this sweeter:
<define name="template" args="TITLE">
<html>
<head>
<title>TITLE</title>
</head>
<body>
Some body text
</body>
</head>
</define>
Think of this as "HTML generation by example": you provide most of the
code, leave a few parameters free, and fill in the parameters when you
know them.
We've written a reader that converts rudimentary Scheme of this form
into actual Scheme that you can run. That is, plug in the new reader,
and you can actually run the above program.
> Mostly you get
> HTML from them, or XSLT if you're very lucky. You will never get that
> sort of mark-up from them, because they have no tools to develop it.
Depends. My development tool is all of DrScheme. What's yours? (-:
(You might want to write John Clements, <clements@cs.rice.edu>, and
ask him for our "little languages" paper. The code in it doesn't run
any longer with the version changes, but if someone's interested ...)
Shriram