In theory, there is no difference between theory and practice. In
practice, there is. -Yogi Berra (maybe).
The recent thread on the new seq functions spun off into a theoretical
discussion about whether about the merits of having contains? and seq-
contains? as separate functions. I would
Hi,
did you also check some? I would use (some #{item} coll)
or (some #(= % item) coll) from core instead of sucking in
3.5Mb contrib for includes?.
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
Good point, and no. There are several (but not dozens) of calls to
some. It appears that all of them are places where search is known to
be O(n) on small data, and (most importantly!) *none* of them include
an instance check to see if there is an associative collection
available.
Stu
While I have no position on seq-contains?, I question this methodology, which
I've seen a few times now. It's early days for Clojure, you're sampling a very
small codebase, and there may be as yet unforseen idiomatic uses (such as you
point out for testing) which invalidates this argument. In
On 2010 Apr 29, at 8:27 AM, Meikel Brandmeyer wrote:
did you also check some? I would use (some #{item} coll)
or (some #(= % item) coll) from core instead of sucking in
3.5Mb contrib for includes?.
Odd, isn't it, that there is a special function zero? when everyone
could just use #(= 0 %)
Agreed: Rich's explanation is the more important bit.
My point is that we may be wasting time arguing about something that
nobody actually does. If idiomatic usage changes as the community
grows, we *could* add a collection-generic contains.
While I have no position on seq-contains?, I
On Apr 29, 5:10 am, Stuart Halloway stuart.hallo...@gmail.com wrote:
(There are a few calls to seq-contains? in the test suite for contrib,
and I wrote all of them. If you write lots of unit tests you already
know why such calls make sense there.)
For those of us who are newbies, would
The final proposition in the other thread to rename contains? into
contains-key? and seq-contains? into contains-val? seems good, no ?
Don't you think they are better names ? (contains-key? indicates more
clearly that the coll is viewed as an associative thing ;
contains-val? implies it will work
Hi,
On 29 Apr., 15:34, Douglas Philips d...@mac.com wrote:
did you also check some? I would use (some #{item} coll)
or (some #(= % item) coll) from core instead of sucking in
3.5Mb contrib for includes?.
Isn't your real beef/bug-report here that you won't use a meaning/
intention
On Apr 29, 9:57 am, Stuart Halloway stuart.hallo...@gmail.com wrote:
Agreed: Rich's explanation is the more important bit.
My point is that we may be wasting time arguing about something that
nobody actually does. If idiomatic usage changes as the community
grows, we *could* add a
On Apr 29, 2010, at 15:10 , Stuart Halloway wrote:
In theory, there is no difference between theory and practice. In practice,
there is. -Yogi Berra (maybe).
...
Also, AFAICT, there are *no* examples of using instance checks to select the
right containment function. So the theoretical
Hi,
On 29 Apr., 14:10, Stuart Halloway stuart.hallo...@gmail.com wrote:
In theory, you may be right about 'contains?.' In practice, Rich
Hickey is right. - Stu Halloway. :-)
probably a little off-topic, but to me the most irritating thing about
contains? is, that it just returns nil (RT/F,
12 matches
Mail list logo