4 ms·
> Come up with a better way of representing an Abstract Syntax Tree in text, please. Perhaps you could use indentation like Python or YAML, for example?
by rdtsc 17y ago
> Come up with a better way of representing an Abstract Syntax Tree in text, please.
Perhaps you could use indentation like Python or YAML, for example?
- plorkyeran 17y agoWhile a cute idea, I suspect the sheer number of newlines required would make it hard to read. Even a simple compound statement like (+ (* x y) (* z w)) would require at least three lines.
- astine 17y agoThere is at least one attempt at this called 'Sweet Expressions' still floating out on the web somewhere. It got horribly ripped by the c.l.l community. Personally, I don't see that it adds anything to the language but ambiguity. It's worth looking, however, at if you are interested in alternative syntaxes for Lisp.