On 2010 Apr 5, at 10:29 AM, Per Vognsen wrote:
In languages like Python and Smalltalk that conflate value and
identity, you need nasty tricks like abusing the garbage collector's
object graph traverser to find all references to a given object (e.g.
gc.get_referrers() in Python) and then rewire those references on the
fly.

Not the point. If it were, how could I do:
    #{ #{ 1 2 3 } #{ 4 10 100 } }
without having to use refs to the interior sets?


Even in clojure I can have values containing other values (not refs), but only if I build acyclic graphs and so long as I build them from the leaves "up."

Immutability is orthogonal to reference-ness.
There is nothing "wrong" with having immutable cyclic graphs of values. (modulo JVM GC details, I'm not an expert)

STM fixes (among other things) the non-composible-ness of locks.
STM provides the right tools (the A and I of ACI propertties) to permit making cyclic values.

That they can't be done now is not an inherent issue of value vs. identity, just a limitation of the current implementation.

Wait, don't transients (http://clojure.org/transients) solve this problem? I'm not sure, but it seems that if persistent! took multiple values it could... Hmmm...

    -Doug

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

To unsubscribe, reply using "remove me" as the subject.

Reply via email to