From: ts Date: 2002-01-13T01:40:23+09:00 Subject: Re: Changes to block behavior in ruby 1.6.6 >>>>> "T" == Tobias Reif writes: T> while number <= limit T> yield number T> number += step T> end [...] T> upto 7 do |number| [...] T> run in 1.6.6? yes, because you call the block which is given to the method What don't work is def another_method(number) yield number end def upto limit,modifier=:default number,step = case modifier when :even then [2,2] when :odd then [1,2] when :default then [1,1] end while number <= limit another_method number # here the modification number += step end end the block is given to #upto and not propagated to #another_method If you want to give the block to #another_method you must propagate it, i.e. def upto limit,modifier=:default, &block number,step = case modifier when :even then [2,2] when :odd then [1,2] when :default then [1,1] end while number <= limit another_method number, &block # here the modification number += step end end Guy Decoux