Ran into an interesting problem today. In short, this works: (count (repeat 1e8 "stuff"))
But this doesn't: (map count [(repeat 1e8 "stuff")]) To be fair, given sufficient memory, it would eventually complete. (If the second example does work for you, change it to 1e10 or something higher). The first one works because nothing is holding on to the head of the seq. My assumption is that the second is eating memory because map still has a reference to the item being processed, while the call to count is causing it to be evaluated. Thus the whole seq is retained and we run out of memory. Is my guess correct? If so, is there a workaround for this? Thanks, Matt -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.