nobu.nokada
11/12/2004 1:01:00 PM
Hi,
At Fri, 12 Nov 2004 19:23:27 +0900,
gabriele renzi wrote in [ruby-talk:120026]:
> > Well, it did just those things, IIRC. Yes, "many" was not
> > correct word, but, even in bundled libraries, tests and
> > samples, some codes were using the variable of the same name as
> > a method.
>
>
> sorry if I'm asking a stupid question, I know I am dumb.. but would'nt
> be enough to give precedence to a method when called and to the variable
> when not explicit called?
> I.e.
>
>
> a=proc {|x| 'proc' }
> a # #<Proc:0x02befeb0>
> a() # 'proc'
> a 10 # 'proc'
> def a(x) p 'meth' end
> a # #<Proc:0x02befeb0> precedence to var, as now
> a() # 'meth' precedence to meth as now
> a 10 # 'meth' precedence to meth as now
Yes, my patch implemented as you mentioned. But, for instance,
a code in sample/test.rb:
method = method(m)
`method' is defined at the moment assignment expression
appears, so `method()' in RHS calls that variable which is
defined but not assigned yet.
--
Nobu Nakada