On Oct 3, 2008, at 9:50 AM, Paul Barry wrote:

> The fact that contains? is semantically different than
> java.util.Collection#contains is confusing.  If contains? was called
> contains-key?, that would be more intuitive and map to how it works in
> Java.


Several times I've made the mental note: when I see contains? I need  
to think contains-key?. I think changing the name to contains-key?  
would make the meaning very clear.

Also, if you're dealing with values that are known not to be false or  
nil (which I suspect is a common case), (contains? m k) is equivalent  
to (m k). Typing the extra "-key?" seems worth it for its clarity in  
the "false or nil is possible" case.

--Steve


--~--~---------~--~----~------------~-------~--~----~
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
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to