On Mar 23, 2009, at 5:24 AM, Jeff Valk wrote:
> > On Mon, 23 Mar 2009 at 03:29, Mark Engelberg wrote: > >> But it traverses m twice, which is likely to be less efficient. > > I wondered about this too, and actually no. I think Mark was referring to the call to 'keys'. But apparently Clojure doesn't need to traverse the map to generate the keys? > Zipmap is efficient. It constructs its return map in a single loop > from two lazy seqs. Not sure what you mean here. It will produce a map from any 2 seqs. And it does not generate it lazily--it uses loop. Don't try this at home: (zipmap (map str (iterate inc 1)) (iterate inc 1)) > Aloha, David Sletten --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---