First, thanks everybody for explanations of design decision behind map and
collections. I should in fact change subject to seq semantics ;-).

For me the bottom line is that while I do not care about order so much I
still can count on that  seq function will produce consistent sequences. Or
wait a sec:



> This might be too detailed a point, but I wanted to mention that while you
> will always get the same order for the same collection (same as determined
> by identical?, or Java ==, i.e. it is the same object in memory), you are
> *not* guaranteed to get the same order for collections of the same type
> that are equal to each other as determined by Clojure = or Java .equals.
> In particular, if two values have the same hash value, then if they are
> used as a set in a Clojure PersistentHashSet or a key in a
> PersistentHashKey, they are put into a linear list in a hash bucket for
> that hash value, and their order in that list can be different in different
> sets/maps, and the order that (seq ...) returns on those sets/maps will be
> different.
>
> I am not certain, but this might violate referential transparency
> (replacing a value that is equals for another value in an expression will
> always give you an equal result).
>

This is not too detailed. In fact this is the ultimate question. It would
mean that two logically identical sets can produce different LazySeq's
depending how they came to existence ...

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