"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 like to ground that
discussion with some observations from real-world use:
Doing an O(n) search of a seq (via includes? or, under its new name,
seq-contains?) occurs the following number of times in various
libraries:
Clojure: 0.
Contrib: 0.
Compojure: 1. (and it's wrong--should be a set test)
Incanter: 0.
(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.)
Also, AFAICT, there are *no* examples of using instance checks to
select the right containment function. So the theoretical concerns
about this issue have basically no exemplars in practice.
"In theory, you may be right about 'contains?.' In practice, Rich
Hickey is right." - Stu Halloway. :-)
--
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