On 1 Sep, 2011, at 10:35 , Alan Malloy wrote:

> I don't see any reason for it to include !=, which can be implemented
> as (not (= a b)). Conversely, <= could be implemented as (or (< a b)
> (= a b)), but if either of those is expensive operations he gives you
> a chance to do a more-optimized <=.

Right, and that's also the reason why there should be not=, with a default 
implementation that does (not (= ...)). It can be expensive to establish 
equality for a complex data structure, whereas inequality can be ascertained at 
the first difference encountered.

Along the same lines, <= has a default implementation that does (not (> ...)), 
but it is possible to provide specific optimized implementation for any 
argument type.

So to respond to Sam's original question:

>> Thanks for such a useful set of libraries. Oh, and whilst we're on the 
>> subject, is there any reason why generic.comparison doesn't include !=

I have simply forgotten to include it.

Konrad.


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