Thanks Ken,
 I guess sorted-map and sorted-set are the solution for a problem like this.
Sunil.

On Wed, Dec 1, 2010 at 12:11 PM, Ken Wesson <[email protected]> wrote:

> I don't think you should be relying on anything like this. I would
> expect, but not want to rely on, two hashsets or hashmaps with the
> same contents generating same-order seqs. It definitely fails for
> PersistentArrayMaps:
>
> user=> (seq {1 1 2 2 4 4})
> ([1 1] [2 2] [4 4])
> user=> (seq {4 4 2 2 1 1})
> ([4 4] [2 2] [1 1])
>
> Those seem to seq out in the reverse order their mappings were made
> (and literals seem to get reversed):
>
> user=> (seq (assoc {1 1 2 2} 4 4))
> ([4 4] [1 1] [2 2])
> user=> (seq (assoc {4 4 2 2} 1 1))
> ([1 1] [4 4] [2 2])
>
> (Array, my foot, looks more like the new mappings are just being
> consed onto the start of a list to me!)
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> [email protected]<clojure%[email protected]>
> 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 post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to