On 1 Sep, 2011, at 14:51 , Konrad Hinsen wrote:
> 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.
I must assume that nobody read that message, as there should have been loud
complaints. There is obviously no difference in performance between = and not=,
as the result of either one is known as soon as one can decide equality OR
non-equality.
I have added a plain function not= to clojure.algo.generic.comparison as a
convenience, it is just the negation of generic =.
The freshly migrated version of clojure.contrib.generic is now available at
http://github.com/clojure/algo.generic
Tested with Clojure 1.3 beta 3.
Konrad.
--
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