On 2010 Apr 29, at 7:52 AM, Laurent PETIT wrote:
2010/4/29 Mark J. Reed <markjr...@gmail.com>:
I like this proposal.  I'd make contains? an alias for contains-key?
with a deprecation warning, and just forget about seq-contains? in
favor of contains-val?

This makes a lot of sense to me.
(and have, as suggested by ataggart, contains-key? complain if passed a seq)

user=> (assoc '(1 2 3) 3 4)
java.lang.ClassCastException: clojure.lang.PersistentList (NO_SOURCE_FILE:0)

If contains-key? complains any less cryptically, then perhaps assoc should to?
(I'm certainly willing to submit potential patches in this area...
assoc's failure to 'protect itself/provide a more useful complaint message' seems duck-type-y... it seems that contains-key? should keep in line with assoc, or visa- versa, whichever is the more clojure-y approach.)

-Doug

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

Reply via email to