From: dblack@... Date: 2007-07-11T06:33:30+09:00 Subject: Re: Yield should be renamed call_block Hi -- On Wed, 11 Jul 2007, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Yield should be renamed call_block" > on Tue, 10 Jul 2007 00:55:04 +0900, dblack@wobblini.net writes: > > |If this ends up happening, I would (reluctantly) suggest getting rid > |of "yield", and just use call. b.yield, as others have pointed out, > |doesn't really work semantically: the function isn't yielding, it's > |being yielded *to*. > > Since I am not a English speeker and I usually dont use that particlar > word, I feel like "yield" as rather like a symbol vaguly related to > passing valu to the blok. Vagueness would be OK, maybe, but the problem is bigger than that: it's that "block.yield" just doesn't express what's happening. > Besides that, receivers often plays subjective roles for verbs > (method names), for example thread.kill or file.close, etc. Those aren't the same, though: kill this thread close this file stream yield this function??? <= doesn't work, in terms of language It's gets even more confusing with an argument: block.yield(x) Are you yielding x, or the block? Basically "yield" is a great name for a keyword (please don't remove it ! :-) but very problematic as a "call" alias. I'd advise fairly strongly against using it that way. David -- * Books: RAILS ROUTING (new! http://www.awprofessional.com/title/0321509242) RUBY FOR RAILS (http://www.manning.com/black) * Ruby/Rails training & consulting: Ruby Power and Light, LLC (http://www.rubypal.com)