3 ms·
S-expressions are great once you've figured out functions, atoms, complex data types, etc. That's how Amazon's Ion[1] uses them: as a nice supplement to a seria
by ben509 6y ago
S-expressions are great once you've figured out functions, atoms, complex data types, etc. That's how Amazon's Ion[1] uses them: as a nice supplement to a serialization standard.
> “CAR”/“CDR” are not a part of the expression syntax
If you were implementing them for a serialization format, you'd leave out cons cells and car / cdr.
But in late-binding LISPs, which is where they're typically used, (a . b) is part of the syntax. It's worth calling out for why you don't want it: it's badly typed since it could be a 2-tuple, or it could be a list depending on what 'b' is.
[1]: https://amzn.github.io/ion-docs/docs/spec.html#sexp https://amzn.github.io/ion-docs/docs/spec.html#sexp