Generally, if the map is behaving like small struct, and you are accessing fields of it, (:keyword map) is idiomatic, and mirrors (.fields object). If the map is used like a data-structure, or a mapping function, then (map :keyword) is more idiomatic.
Note that if you are using defrecords, (:keyword record) performs better, because the clojure compiler generates some shim implementations that let the underlying field get accessed directly. On Tue, Jan 29, 2013 at 2:00 AM, Jonathon McKitrick <[email protected]>wrote: > Either one works, is there any kind of guideline on which to prefer, when? > Or is it entirely personal preference? It seems each way could be more > readable in different circumstances.... > > -- > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to [email protected] > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > [email protected] > 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 [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
