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 Thu, 24 Oct 2019 at 05:32, Anton Vodonosov <avodono...@gmail.com> wrote: > 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 (unlike clojure map literals) > > I mean, > > (edn/read-string "{a 1 b 2}") > > works, while using a clojure map literal would require quoting A and B: > > {'a 1 'b 2} > > So, is it a good idea to use symbols instead of keywords as map keys in a > config file? > > Probably, an advantage of keywords that they look different visually, so a > reader easily distinguishes keys from values; But proper indentation, > optional commas between the key-value pairs in map may be enough for a > reader to understand everything immediately. > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/clojure/b4c1d021-a624-482b-9e75-fa5c08057a42%40googlegroups.com > <https://groups.google.com/d/msgid/clojure/b4c1d021-a624-482b-9e75-fa5c08057a42%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- James Reeves booleanknot.com -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CALg24jRyjXXT%3DNarD2%3DFjNZXb_06tfCZwyAyFZAK%2BQWK3YtaiA%40mail.gmail.com.