Since Clojure is not a pure language, you cannot even expect (a == a) ==> ((f a) == (f a)), so I do not think it is a stretch to break that theorem for b != a.
Most importantly, Clojure's notion of equality is centered around the notion of simple data, irrespective of the specific type of object you have built to encapsulate it. On 9 April 2013 11:00, Tassilo Horn <[email protected]> wrote: > JvJ <[email protected]> writes: > > > This is just an idle curiosity up for discussion, but in Clojure, if > > (= a b) is true, then given some function f, it is not necessarily > > true that (= (f a) (f b)) > > I think this axiom isn't true in any language. Take `str` / toString() > as an example. If that statement was true, then equal objects would > need to have equal string representations. Then you either couldn't > have 1 and 1.0 be equal, or you would need to print all numbers as > floats. An even better counter example are sets versus sorted sets. > > Bye, > Tassilo > > -- > -- > 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 > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
