4 ms·
As others have mentioned, "text" is rarely unstructured in practice: it's just that the "structure" is ad-hoc, relying on things like whitespace, newlines, vari
by nicklaf 8y ago
As others have mentioned, "text" is rarely unstructured in practice: it's just that the "structure" is ad-hoc, relying on things like whitespace, newlines, various punctuation, etc.
I mean, there's a reason why regular expressions were one of the first things that went into Unix. But with lisp, you need neither regular expressions nor separate parsers for each format, because s-expressions enforce a uniform encoding of all structure in a data structure (a tree), which is parsed automatically by the interpreter!
Edit: And, as lisper clarifies, "S-expressions are more expressive than text that adheres to the typical unix conventions" [0], meaning that s-expressions make it trivial to arbitrarily extend that structure (whereas doing the same beginning from Unix conventions gets messy very quickly; see, e.g., lisper's example of parsing HTML).
[0] https://news.ycombinator.com/item?id=19274518 https://news.ycombinator.com/item?id=19274518