On Tue, 22 Feb 2011 16:23:00 -0800 (PST)
Alan <a...@malloys.org> wrote:

> Yes, it is guaranteed, and I'm dubious about your claim about
> serializing. (seq foo) will return the entries in foo in the same
> order always; but (seq (assoc foo 1 2)) may return the entries in a
> completely different order. You can treat (keys x) as if it were
> defined by (map key (seq x)):

References please?

There was a discussion a while back about why maps weren't treated as
sequences, the gist of it being that (seq somemap) wasn't guaranteed
to always return things in the same order, and requiring an explicit
conversion was a reminder of that. Given that, the fact that (keys x)
can be treated the same as (map key (seq x)) isn't sufficient to
guarantee that (keys x) and (vals x) will return things in the proper
order to zipmap them.

Given that it was an email discussion, it could well have been wrong -
or things could have changed since then. But I'd like to see a
reference to that effect, other than the fact that the current
implementation behaves that way.

      Thanks,
      <mike
-- 
Mike Meyer <m...@mired.org>             http://www.mired.org/consulting.html
Independent Software developer/SCM 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

Reply via email to