[racket] comments requested from users of SXML and PLT xexprs

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Thu Dec 23 08:10:17 EST 2010

2010/12/23 Noel Welsh <noelwelsh at gmail.com>:
> On Tue, Dec 21, 2010 at 2:20 PM, Neil Van Dyke <neil at neilvandyke.org> wrote:
>> Here's a simple example, which doesn't demonstrate all the features:
>>   (html-template
>>     (html (head (title "Foo & Bar"))
>>           (body (h1 (*value* essay-title))
>>                 (p "Bunnies are nice." (br) "Yep."))))
> ...
> Looking forward to seeing it (and the other libraries).
> We've been using Scala / Lift a bit recently, and it has an
> interesting approach to templating. For a start all template
> processing functions are NodeSeq -> NodeSeq, which is the Scala
> equivalent of List -> List. I.e. they get around the splicing problem
> by requiring you to always return an HTML element such as a span or
> div. Some may find this aesthetically displeasing but it is minor and
> makes the system simpler. I recommend the same; trying to keep things
> straight otherwise (particularly without a type system) is too hard.
> Lift templates contain no code, but rather specify the points, using
> conventions in the markup, where the template processor (called a
> snippet) should insert values. It is up to the snippet to, say, loop
> over some set of values and so on It is a bit an inversion of the
> usual template system, where we think of the template as a function
> from some values to XML.
> There is a bit more here:
> http://simply.liftweb.net/index-Chapter-6.html#toc-Section-6.1
> http://simply.liftweb.net/index-6.9.html#toc-Section-6.10
> Lift templates are not 100% awesome (for example, the contract they
> define is completely implicit) but I think they work better than
> having for-each / map etc. in templates.

Pete Hopkins had a version of Continue that worked that way. It was
pretty nice, because it used standard HTML ids and CSS style
attributes in the template to communicate to the program. I could dig
up the code and we could apply it more generally in Racket.


> HTH,
> N.
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users

Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University

"The glory of God is Intelligence" - D&C 93

Posted on the users mailing list.