Am Freitag, 16. September 2011 schrieb David Nolen :
>
> The other thing to consider is that - is this a contract that is desirable
> to support? Transients are only about performance - lowering the time it
> takes to construct a collection. Perhaps there are faster implementations
> which cannot fulfill the contract of supporting contains?
>

Fair point!
OTOH such an implementation would still need to support get, which is
supposed to be fast too (the reason it's stated explicitely in the contains?
doc is, so that people don't confuse it with some)
In fact, one could implement contains? as

(defn contains? [c x]
  (not= ::not-found (get c x ::not-found)))

right now and retain the performance guarantees. And it would work on
transients too :)

kind regards


-- 
__________________________________________________________________
Herwig Hochleitner

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
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