2 ms·
> They prevent easier program concatenation and ad hoc parser writing. This assertion is patently false. Parens make it quite trivial to parse and render the u
by geezerjay 7y ago
> They prevent easier program concatenation and ad hoc parser writing.
This assertion is patently false. Parens make it quite trivial to parse and render the underlying tree structuee rather obvious. Concatenating programs is just a matter of splicing a subtree into the target tree.
- breck 7y ago> This assertion is patently false. Here's a proof. - In S-Expressions with parens, there are infinite ways to write any given abstract syntax tree. - In Tree Notation, there is only 1 way to write any given abstract syntax tree. If you change one letter, you get a different tree. - Say I wrote programs in a Tree Language with a root node called "dumpToConsole" and I want to rename all such nodes to "print". I can write a type-safe ad hoc parser that does a simple search replace "/\ndumpToConsole/print/", using Tree Notation. If it were in S-Expressions, I'd have to use a full parser.