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 may not sound useful but once you wrap you head around it, situations 
where this simplifies things pop up often enough.

/PJC 

On Wednesday, August 7, 2013 6:28:00 PM UTC+2, Abraham wrote:
>
>  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 function or any other data 
> struc. is used as key?
>
> Thnks
> A
>
>

-- 
-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to