On Tuesday, May 12, 2015 at 5:05:00 PM UTC-4, Michael Gardner wrote:
>
> On May 12, 2015, at 3:28 PM, Fluid Dynamics <a209...@trbvm.com 
> <javascript:>> wrote: 
> > Strings and arrays support constant-time access by index. 
>
> Yes, but why should that mean that contains? should work on Strings? 
> "Because it can" doesn't seem compelling to me. In discussions about 
> contains?, one often hears that it works on associative containers, which 
> is supported by the use of the word "key" in its docstring. Vectors are 
> indeed associative, but Strings aren't (at least according to 
> associative?), which is why this seems like a strange feature to me.


Yes; and presumably you can't produce a string with one character changed 
using "assoc" either.

But it should work consistently. Either it shouldn't work for strings, or 
it should work fully, including producing nil for not-found with nonnumeric 
keys. Ditto arrays. 

-- 
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/d/optout.

Reply via email to