JvJ writes:

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

Baker's "Equal Rights for Functional Objects" is the best overview of
equality semantics I've ever read:

http://home.pipeline.com/~hbaker1/ObjectIdentity.html

> Two objects are "operationally equivalent" if and only if there is no
> way that they can be distinguished, using ... primitives other than
> [equality primitives]. It is guaranteed that objects maintain their
> operational identity despite being named by variables or fetched from or
> stored into data structures.

Clojure is inspired by it, but cheats in a number of places. The
most obvious being the way that seqs and vectors can be considered
equal. This could be considered cutting corners in order to make
laziness less onerous to deal with. IIRC there are a few other places
where Clojure deviates from this definition of operational equivalence
around defrecord and deftype, but since I don't use those features the
details escape me at the moment.

-Phil

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