Re: Function as key of a map

2013-08-08 Thread Peter Juhl Christiansen
Here is a somewhat simplified example: Lets say you decide to model positions as {:x 12 :y 10} {:x 23 :y 34} ...And then you want to describe what is present at each of these positions Then this can simply be done using a map { {:x 12 :y 10} "A house", {:x 23 :y 34} "Other house"} This ma

Re: Function as key of a map

2013-08-07 Thread Matching Socks
Consider clojure.core/frequencies -- -- 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 unsubsc

Function as key of a map

2013-08-07 Thread Abraham
this is in reference to the followng article http://blog.safaribooksonline.com/2013/08/06/two-simple-clojure-tricks-with-values/ wherin it says any value ( function , vector , other data structure of clj) can be used as key for a hashed map. can anybody enlighten how is it useful if functi