3 ms·
why not go further, why can't we just write <tree <leaf colour="green"> <leaf colour="yellow"> > although now that ="foo" business seems too noisy
by MawKKe 3y ago
why not go further, why can't we just write
<tree
<leaf colour="green">
<leaf colour="yellow">
>
although now that ="foo" business seems too noisy. how about
<tree
<leaf :colour green>
<leaf :colour yellow>
>
also, those angle brackets are too pointy, let's swap them to something more pleasant
(tree
(leaf :colour green)
(leaf :colour yellow))
- yarg 3y agoThe change I suggested is backwards compatible - probably a relatively small change to a single method in parsing. You, on the other hand, took the pre-existing syntax and contemptuously threw it out the window - and completely ignored the advantage of widespread tacit understanding.
- throwaway744678 3y agoDon't sweat it, it was a joke (turning your sample into LISP)
- yarg 3y agoSorry, I haven't spent any time with LISP. I do however want to write a dialect of it, though mostly for the sake of naming it 'Lithp'.
- bad_login 3y agoHere is the racket view of xml https://docs.racket-lang.org/sxml/SXML.html https://docs.racket-lang.org/sxml/SXML.html more examples: https://docs.racket-lang.org/sxml/ssax.html https://docs.racket-lang.org/sxml/ssax.html and then you can manipulate your sxml with https://docs.racket-lang.org/reference/match.html https://docs.racket-lang.org/reference/match.html
- lionkor 3y agoi dont have eyes so id prefer enum Color { green, yellow }; struct Leaf { Color color; }; std::vector<Leaf> tree = { { .color = green }, { .color = yellow }, }; which has the benefit of requiring a massive compiler suite, a specific language version, but it compiles to 0 bytes because it's not used (how great!!)