Gregory Brown
7/10/2007 8:51:00 PM
On 7/10/07, Yukihiro Matsumoto <matz@ruby-lang.org> 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.
>
> Besides that, receivers often plays subjective roles for verbs (method
> names), for example thread.kill or file.close, etc.
That's true, but I shared the same confusion as David does when I was
playing with 1.9.
block.yield to me sounds like the opposite of block.call
In fact, my first instinct was to think this allowed currying for some reason.
like
block = lambda { |x,y| x + y + 3 }
block2 = block.yield(2)
block2.call(4) #=> 9
Of course, that imaginary syntax isn't a good idea either, but that's
what came to mind.