From: "Peña, Botp" Date: 2008-09-12T10:27:16+09:00 Subject: Re: Advanced conditionals From: David A. Black [mailto:dblack@rubypal.com] .. #For a little while, 1.9 allowed you to do this: #>> e = [1,2,3].enum_for(:map, &lambda {|x| x * 10 }) #=> # #>> e.select {|n| n > 10 } #=> [20, 30] #But #enum_for no longer accepts a &block-style argument. The same code #in current 1.9 would give you [], because it would ignore the lambda #and just do a pass-through mapping. #I'm still unclear as to why this behavior was removed. It seems to me #that its removal reduces the usefulness of enumerators drastically. maybe because it does not look any better than the simpler (but less efficient) > e = [1,2,3].select{|n| n>1}.map{|x| x*10} =>[20,30] i was actually dreaming of ruby supporting multiple blocks so that you can do simply > e = [1,2,3].select{|n| n>1},{|x| x*10} =>[20,30] meaning, do a (re)map if a second code block is passed kind regards -botp