[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: ruby1.9 block scope

Yukihiro Matsumoto

9/30/2008 8:08:00 AM

Hi,

In message "Re: ruby1.9 block scope"
on Tue, 30 Sep 2008 16:49:19 +0900, Mike Gold <mike.gold.4433@gmail.com> writes:

|Making the scope of x contingent upon what comes later would result, I
|believe, in extreme confusion.

|One might argue that when 'x = 45' appears before bar and baz, this
|_already_ changes the meaning of bar and baz. But the situation here is
|entirely different, in my mind. Don't most of us read code from top to
|bottom?

Understandable. That's the very reason the current Ruby does not work
like this.

matz.

1 Answer

Mike Gold

9/30/2008 8:24:00 AM

0

Yukihiro Matsumoto wrote:
> Hi,
>
> In message "Re: ruby1.9 block scope"
> on Tue, 30 Sep 2008 16:49:19 +0900, Mike Gold
> <mike.gold.4433@gmail.com> writes:
>
> |Making the scope of x contingent upon what comes later would result, I
> |believe, in extreme confusion.
>
> |One might argue that when 'x = 45' appears before bar and baz, this
> |_already_ changes the meaning of bar and baz. But the situation here is
> |entirely different, in my mind. Don't most of us read code from top to
> |bottom?
>
> Understandable. That's the very reason the current Ruby does not work
> like this.
>
> matz.

The current ruby doesn't, but a future one might? The reason I posted
was because the phrase "I haven't introduced it yet" might imply that it
could happen.
--
Posted via http://www.ruby-....