On Mon, 6 Dec 2010 16:30:10 -0500 Ken Wesson <kwess...@gmail.com> wrote:
> On Mon, Dec 6, 2010 at 1:05 PM, Stuart Sierra > <the.stuart.sie...@gmail.com> wrote: > > On Dec 6, 8:36 am, Ken Wesson <kwess...@gmail.com> wrote: > >> Furthermore, the comment (not made by Hickey) that map order "may be > >> unstable" is more than a little puzzling in light of the fact that the > >> maps in question are immutable. :) > > > > In general, Rich has been careful not to promise things that might > > limit changes he can make in the future. Sets and maps are unordered. > > `seq` happens to be deterministic on ArrayMap and HashMap, but there > > might some day be some other kind of map or set for which `seq` cannot > > be deterministic. Therefore, Clojure does not promise anything about > > `seq` on maps, other than that it will return the key-value pairs. > > I confess I can't see any obvious reason ever to make seq > nondeterministic on an immutable data structure. I suspect you're applying "immutable" to everything about the data structure, whereas it can also be applied the value without including the implementation. I can see wanting to change the implementation in ways that don't change the value - triggered by something like wanting to share parts of the value with another structure, or a garbage collection, or ... - which could easily change the results of calling seq on the structure. Not that I know that anything in clojure does that, just that I can see conditions where you might want to. <mike -- Mike Meyer <m...@mired.org> http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. O< ascii ribbon campaign - stop html mail - www.asciiribbon.org -- 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