2 ms·
I think you may have been voted down because the form you have made is not close to S-expressions at all. Sexps are a direct way of encoding a tree of symbols,
by Robin_Message 17y ago
I think you may have been voted down because the form you have made is not close to S-expressions at all. Sexps are a direct way of encoding a tree of symbols, values and other trees - nothing else.
To give an example of why this is powerful, suppose I decide I need two different namespace of attributes. In your example, this is hard. I can either do:
>tagname attr "value" @ attr "value2" !<
which special cases the parsing, and is hard to understand, or
>tagname ns1:attr "value" ns2:attr "value2" @<
which makes it hard to process attributes (xml is like this)
Sexps have an easy, obvious solution
(tagname (@ attr "value") (@other attr "value2"))
which I'd argue is clearer, more backward compatible, and doesn't require changing the parser.
Now this is only one example, but the point of sexps is they don't have an special cases, and they move the semantics out of the syntax and into the processing.