On Mon, 23 Mar 2009 at 20:10, David Sletten wrote: > I think Mark was referring to the call to 'keys'. But apparently > Clojure doesn't need to traverse the map to generate the keys?
The call to keys just creates a seq. There's no traversal until you consume it. > 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)) Indeed that's a good one to avoid. :-) I simply meant that *in the keys/vals example above*, using zipmap is approximately as efficient (in time and space) as for or reduce, a result I found interesting. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---