On Sun, Feb 02, 2003 at 09:11:31PM +0900, Brian Candler wrote:
> On Sun, Feb 02, 2003 at 12:36:52PM +0100, ts wrote:
> > B> But it's not a local variable - it's a formal parameter to a block. At
> > B> least, that's how I look at it :-)
> > 
> >  You have found where is your problem, ruby don't see it like this
> ...
> > [[1, 2]].each {|a.a, $m| }
> > p a.a, $m
> 
> Ugh! Thanks though, that helps me see how the current behaviour (|x| assigns
> to existing local variable x) arises.
> 
> It's difficult to see how that could be made consistent with the proposed
> new behaviour; you can't have a block-local value for 'a.a', because it's
> not a variable, it's a method call.
> 
> Should the above usage be outlawed? In the same way as:
> 
> def myfunc($m) 
> puts $m
> end
> ==> compile error: formal argument cannot be a global variable

I think matz planned to use the implicit ':=' for block-locals and '='
for everything else, so that [1].each { |a.a| } works.

-- 
 _           _                             
| |__   __ _| |_ ___ _ __ ___   __ _ _ __  
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ 
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
	Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

Because I don't need to worry about finances I can ignore Microsoft
and take over the (computing) world from the grassroots.
	-- Linus Torvalds