Clojure sets and maps are functions.
Since they are functions, you don't need functions to get values out of them. You can use the map or set as the example below shows.(#{1 2} 1)
> 1
({:a 2 :b 3} :a)
> 2
That's nice, but it's not exactly game changing. However, when you use sets or maps with high order functions you can get a lot of power with a little code.
For example, the following code removes all of the elements of a vector if the element is also in the set.(def banned #{"Steve" "Michael"})
Published on August 30, 2010 19:52