« Return to Thread: Yield should be renamed call_block

Re: Yield should be renamed call_block

by SonOfLilit :: Rate this Message:

Reply to Author | View in Thread

I find that "yield" describes what the method does even better than
"call_block".

Besides, there is a principle in ruby's design of having the most used
methods be shorter.

It's important because thinking "this function then yields" is far
more consise than thinking "this function then calls call_block".


POLS, btw, is defined as "POLS to Matz", and there is much emphasis on that.


Aur

On 7/9/07, Bharat Ruparel <bruparel@...> wrote:

> One of the virtues of the Ruby language that is touted by just about
> everyone including the language designer Matz is that it is supposedly
> very intuitive, follows principle of least surprise, duck typing and on
> and on.
> I find it fascinating and quite a bit true.  However, I have to always
> mentally translate the keyword "yeild" to mean "call_block".  I find
> that it is the biggest distraction that I have when I am trying to
> figure out what and how a a method with a block and calling code
> interact.  I can understand all that baggage such as "lambda" function
> name from Lisp and the wonderful "$" variables that came from Perl, but
> where did the keyword yeild come from?  And why has not anyone aske Matz
> to consider changing it to infinitely more obvious "call_block"?  It it
> that big a deal?  In an open source language?
>
> --
> Posted via http://www.ruby-forum.com/.
>
>

 « Return to Thread: Yield should be renamed call_block