Re: Keys in EDN maps: keywords or symbols

2019-10-25 Thread James Reeves
As you point out, symbols in edn have no inherent meaning; it's entirely up to how you interpret them. However, if you saw the symbol "clojure.core/conj" in an edn file, then the chances are that it's intended to refer to a Clojure function. Similarly, the symbol "PI" likely refers to the mathemati

Re: Keys in EDN maps: keywords or symbols

2019-10-25 Thread Anton Vodonosov
Thank you for responses. The last two arguments do not resolve the doubt, however: 1. symbols also implement IFn: (require 'clojure.edn) ('a (clojure.edn/read-string "{a 1 b 2}")) => 1 2. EDN does not specify any evaluation model, so how can a symbol designate something "in isolat

Re: Keys in EDN maps: keywords or symbols

2019-10-24 Thread James Reeves
On Thu, 24 Oct 2019 at 16:48, Anton Vodonosov wrote: > Regarding the idea that a keyword is an identifier that designates itself, > while a symbol is a keyword that designates something else. > > Keys in config file map do not designate themselves, they designate the > corresponding map values. >

Re: Keys in EDN maps: keywords or symbols

2019-10-24 Thread David Chelimsky
I think James talking about resolution of values when he said "designates", not "the value bound to a key in the map." In other words, the keyword :email resolves to the keyword :email, whereas the symbol clojure.core/vec resolves to a function. Keywords-as-keys give you some benefits when you'

Re: Keys in EDN maps: keywords or symbols

2019-10-24 Thread Anton Vodonosov
Regarding the idea that a keyword is an identifier that designates itself, while a symbol is a keyword that designates something else. Keys in config file map do not designate themselves, they designate the corresponding map values. {username "vasya" email "a@b.c"} Here the EMAIL symbo

Re: Keys in EDN maps: keywords or symbols

2019-10-24 Thread James Reeves
In edn, a keyword is an identifier that designates itself, while a symbol is a keyword that designates something else. This means keys in a map should generally be keywords, unless they identify something beyond themselves. For example: {:profiling/function-count {clojure.core/vec 10}} On Th

Re: Keys in EDN maps: keywords or symbols

2019-10-24 Thread Jason Felice
My personal opinion is to prefer keywords, and prefer less preprocessing of the configuration before the program uses it. If it gets to a place where the configuration changes a lot, and a "natural" (read: clojure-like) expression of the configuration in EDN has either a lot of redundancy, or bits

Keys in EDN maps: keywords or symbols

2019-10-23 Thread Anton Vodonosov
I'm working on a config file format in EDN, and in doubt: should I use keywords or symbols as map keys. After all, the colon is an extra keyboard press - an extra effort for users. As EDN parser doesn't evaluate expressions, there is no need to quote symbols when using them as EDN map keys (unl