5 ms·
That's exactly what Clojure did, here's the quote from clojure.org: > Extends the code-as-data paradigm to maps and vectors Basically think of it as a better
by didibus 4y ago
That's exactly what Clojure did, here's the quote from clojure.org:
> Extends the code-as-data paradigm to maps and vectors
Basically think of it as a better JSON with non of the issues you brought up.
See: https://github.com/edn-format/edn https://github.com/edn-format/edn
And example:
> #myapp/Person {:first "Fred" :last "Mertz"}
- JonChesterfield 4y agoThe keyword vs symbol distinction still seems weird to me. :first vs 'first. {} delimited sequence of even length is a nice complement to () delimited sequence of arbitrary length though.
- nlitened 4y agoI think of it this way: keywords are like symbols, but they survive serialization/deserialization and macroexpansion intact, so you don't need to be extra careful with quoting to prevent automatic evaluation of the symbol to some other value. And since keywords are used in code very often as keys and enums, it reduces cognitive load immensely.