On Mon, Nov 18, 2002 at 06:13:12PM +0900, Minero Aoki wrote: > [ruby-dev:18651] Enumerable#zip (contd.) > > Matz has noted some preconditions about this issue: > > * The main reason to introduce Enumerable#zip is the parallel > iteration (to be precise, "finite parallel each"). > > * We should not use Thread/Continuation. > > * We should not use external iterator (Iterator pattern). What are the reasons for avoiding external iterators? Using zip for parallel iteration has a nice clean syntax, but I think I'd avoid it for large data structures -- unless it could be defined to return some sort of proxy object that responds to each() instead of an Array. > Under these conditions, following candidates are remained: > > # Enumerable#zip > for x,y in a.zip(b) do ... end > a.zip(b).each {|x,y| ...} > # Problem: If the length of a and b are different, > # which one should we choose? The default value/block does > # not resolve this problem, because it is equal to the > # "choose longest" strategy. > > # Enumerable#sync_each > a.sync_each(b,c) {|a,b,c| ... } > # Problem: "sync_each" is not a good name. How about Enumerable#iterate_with? > [ruby-dev:18739] change chomp! > > Shin-ichiro HARA suggested that String#chomp should cut off > CR and LR at once. Knu pointed out that ruby 1.7 already acts > like such. Does it do this on all platforms or only on Windows? Paul