Hi --

On Thu, 5 May 2005, Joe Van Dyk wrote:

> On 5/4/05, David A. Black <dblack / wobblini.net> wrote:
>> Hi --
>>
>> On Thu, 5 May 2005, Joe Van Dyk wrote:
>>
>>> Can someone fill me in on what's going on here?
>>>
>>> It looks like the code reads something like:
>>>
>>>  def opa(s)
>>>    'z'
>>>  end
>>>
>>> So,
>>>  opa('kct')
>>> should return 'z'.
>>>
>>> But I have no idea what
>>>  opa = opa('kct')
>>> is trying to do.
>>
>> It's trying to set a local variable called opa to the result of
>> calling (the method) opa with arg 'kct'.
>
> Isn't that illegal?  The name 'opa' has already been defined.

That's exactly what Joao is asking :-)  Up to 1.8.2, at least, it's
legal: the namespaces for local vars and methods are separate.  In
the 1.9 CVS it's behaving as if it's illegal, though the nature of the
error message (and the nature of the change itself) raises the
question of whether the change is intentional.


David

-- 
David A. Black
dblack / wobblini.net