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

RE: XML as a transition to s-expr



If we want to migrate people to a consistent syntax, why is the choice
only between s-expr and XML?  Here is a better syntax than either:

table [:cellpadding "0" :cellspacing "0"] [
   tr [] [
	td [:width "50%"] "Cell one"
	td [:width "50%"] "Cell two"
	]
   ]

It is shorter to type, easier to read, and easier to process than
the equivalent s-expr's or XML.  And if you like xml-style end group
balancing you can do use an optonal ';' comment character.

table [:cellpadding "0" :cellspacing "0"] [
   tr [] [
	td [:width "50%"] "Cell one" ;td
	td [:width "50%"] "Cell two" ;td
	];tr
   ];table

Note: This all works because each "function" is presumed to take a fixed
number of arguments.  I think it's ok two have both:

   + 3 5

and

   add [2 3 4 5]

Lisp people may differ on this issue, but I don't think the annoyance of
s-exprs justifies unifying these two functions.  Most functions I use
have a fixed number of arguments.

-Alex-


___________________________________________________________________
S. Alexander Jacobson                   i2x Media
1-917-783-0889 voice                    1-212-697-1427 fax




On Mon, 17 Dec 2001, Anton van Straaten wrote:

> Tony Kimball wrote:
> > Interesting.  I think of s-expr's as eval'able entities,
> > but you think of them as read'able entities.
>
> > (table (:cellpadding "0" :cellspacing "0")
> >    (tr ()
> >      (td (:width "50%")
> >        "Cell one")
> >      (td (:width "50%")
> >        "Cell two")))
>