B Smith-Mannschott <bsmith.o...@gmail.com> writes: >> Calling the set as if it is a fn is a short-hand for "get", that is >> retrieving an element from the set. Why would you want to do this, when >> to look it up you need to know what element is? > > Since you asked: canonicalization. I've wanted this on occasion (in > Java) when canonicalizing (i.e. interning) values.
Yep, that's exactly what I meant by interning. > The obvious alternative is to use a map where each such value maps to > itself. This is no real bother. So, I'm happy that Clojure sets behave > as they do. Being able to use a set as a predicate directly is very > handy. Indeed, under the hood Clojure's hash sets are in fact just a hash map which maps elements to themselves. -- 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 To unsubscribe, reply using "remove me" as the subject.