by Robin_Message · 16y ago · 0 comments
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.
No comments yet.