[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: XML as a transition to s-expr



Tony Kimball wrote:
> Interesting.  I think of s-expr's as eval'able entities,
> but you think of them as read'able entities.

It's a basic tenet of s-exp dogma that they're both, and that's the point.
"Code is data."  If you have some functions called things like "table" and
"tr", then the "code" quoted below can be eval'd as easy as it can be read.
This can be easier than implementing a state machine to understand the
structure; or perhaps more accurately, it's a very natural alternative way
to implement the state machine.

> (table (:cellpadding "0" :cellspacing "0")
>    (tr ()
>      (td (:width "50%")
>        "Cell one")
>      (td (:width "50%")
>        "Cell two")))