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

Re: XML as a transition to s-expr



At 09:58 AM 12/18/01, Dorai Sitaram wrote:
>Scott McKay writes
> >
> > Common Lisp already has a syntax for named parameters.  Lisp hacks
> > like this for generating HTML are common.
> >
> > (table (:cellpadding "0" :cellspacing "0")
> >    (tr ()
> >      (td (:width "50%")
> >        "Cell one")
> >      (td (:width "50%")
> >        "Cell two")))
>
>There are some unnecessary parens here.  I submit that
>s-expression is as much about ruthlessly avoiding
>unneeded parens as about using them when needed.

I think your criteria is confused.  Good engineering is about making
things as simple as possible, but not any simpler than that.  Being
ruthless has nothing to do with it.

You have over-simplified here, by cramming together two different
concepts: "attributes" and "bodies".   How, in your example below,
is a program supposed to know that :width 50% is not part of
the body?  If there is a "coercion" from keywords (like :width)
to strings, then how would you interpret your example.

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