From: Todd Benson Date: 2008-02-09T14:42:25+09:00 Subject: Re: info on block arguments On Feb 8, 2008 11:29 PM, Todd Benson wrote: > In this case, #sort_by throws your block object references (one at a > time) and you are supposed to give it back an object reference that is > comparable (i.e. responds to the <=> method). > > At least, that's the way I understand it without reading the underlying code. > > A _very_ simple example... > > def simple > yield 3 > end > > simple {|i| puts i} I should qualify that 3 is not a reference because it's immutable. The example was just to illustrate how blocks work on a simplistic level. Todd