From: dblack@... Date: 2003-04-27T00:13:40+09:00 Subject: Re: block.call vs. yield Hi -- On Sat, 26 Apr 2003, Hal E. Fulton wrote: > ----- Original Message ----- > From: > To: "ruby-talk ML" > Sent: Friday, April 25, 2003 5:51 AM > Subject: Re: block.call vs. yield > > > > > As a conclusion, you will have compatible behavior when you use > > > blk.yield (new method in 1.8) instead of blk.call. Fix will be > > > available soon on the CVS. > > > > Language comment: > > > > 'yield' as a method name for blocks strikes me as awkward. In the > > past I've never thought of 'yield'ing as an action performed by > > blocks, nor as something they're asked to do; it's more that they are > > executed because they get control because a 'yield' has already > > happened. > > I now see what David is saying. I had failed to > read all of the thread. > > I agree, 'yield' as a method name is not ideal. > Perhaps 'invoke' -- although that is not mentally > associated with 'yield' nor is it mentally > distant enough from 'call'. > > I think those are the two real difficulties in > naming this method: 1. We want people to know > it has the semantics of yield; 2. We want them > to know it is different from call. I think that if the semantics of yield are to be generalized, they should be thought of as something other than the semantics of yield. It seems to me that the situation is somewhat like this: type 1 semantics type 2 semantics _____________________ ___________________ | | | | | | | | methods Proc#call yield Proc#whatever in which case, yield and Proc#whatever share semantics, but there's no reason (except "historical reasons") to define them as "yield semantics". I agree that 'invoke' is problematic. It's sort of arbitrary; it is a different word, but there's no reason to favor the idea that it differs in a particular way from call. Maybe something like call_with_... or call_as... ? (Not sure what the ... would be.) David -- David Alan Black home: dblack@superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav