On Tue, Mar 12, 2013 at 11:00 PM, Paul Butcher <p...@paulbutcher.com> wrote:
> On 12 Mar 2013, at 13:49, Adam Clements <adam.cleme...@gmail.com> wrote: > > How would feeding a line-seq into this compare to iota? And how would that > compare to a version of iota tweaked to work in a slightly less eager > fashion? > > > It'll not suffer from the problem of having to drag the whole file into > memory, but will incur the overhead of turning everything into JVM data > structures that iota avoids. I don't imagine that it would be hard to > modify iota to use a similar approach though. Although I imagine that > Alan's better placed to have an opinion on that :-) > If you're dealing with a stream that you'll only read once, then Paul's foldseq+line-seq should work much more effectively than Iota I'd think. Iota generates an index of line numbers so (nth iota-vec 100) is O(1), which is why it'll read through the entire file on loading. If you only need to access each line once, then that initial indexing step is likely a waste. If Paul wouldn't mind I'd like to add a a similar "seq" function to Iota that would allow for index-less processing like he did in foldable-seq. -- -- 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/groups/opt_out.