[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Yield should be renamed call_block

Yukihiro Matsumoto

7/9/2007 11:05:00 PM

Hi,

In message "Re: Yield should be renamed call_block"
on Tue, 10 Jul 2007 06:51:03 +0900, Florian Gross <florgro@gmail.com> writes:

|Currently, it is still possible for the method to check for blocks it
|doesn't want by itself, though. (raise if block_given?)

If you check explicitly, yes. But implicit is better than explicit,
if you and computer feel same way.

matz.

1 Answer

Bertram Scharpf

7/10/2007 12:10:00 AM

0

Hi,

Am Dienstag, 10. Jul 2007, 08:05:04 +0900 schrieb Yukihiro Matsumoto:
> In message "Re: Yield should be renamed call_block"
> on Tue, 10 Jul 2007 06:51:03 +0900, Florian Gross <florgro@gmail.com> writes:
>
> |Currently, it is still possible for the method to check for blocks it
> |doesn't want by itself, though. (raise if block_given?)
>
> If you check explicitly, yes. But implicit is better than explicit,
> if you and computer feel same way.

There is a implication uncertainity relation: either
`&block' is implicit or `raise if block_given?' is.

In 95% of my code it's more convenient to have `&block'
implicit. I _feel_ much better with the former.

Bertram


--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-...