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

For instance:

(defn check-eq
[f a b]
[(= a b)
(= (f a) (f b))])

(check-eq #(conj % 1) '(1 2 3) [1 2 3])
[true false]

Even though the behaviour of lists and vectors differs under specific 
functions, they still count as equal, but this statement "If a = b, then (f 
a) = (f b)" seems like it would be some sort of rule or axiom about 
functional programming.  What's the FP purists' view on this?



-- 
-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to