From: "Erik Bågfors" Date: 2002-02-07T06:10:45+09:00 Subject: Re: Variable over function On Wed, 2002-02-06 at 22:01, Dat Nguyen wrote: > Hello all, > What's the reason behind the following: > aNum = 19 > def aNum > return "A free function" >end >puts aNum # => 19 >Question: Why can't "def" redefine aNum ? You have one method named aNum and one variable with the same name. When you ask from aNum in the puts statement the varable is used. If you try "puts aNum()" ruby will know it's a method and call that. If there is no variable named aNum ruby will use the method even without the "()" /Erik -- Erik B�gfors | erik@bagfors.nu Supporter of free software | GSM +46 733 279 273 fingerprint: 6666 A85B 95D3 D26B 296B 6C60 4F32 2C0B 693D 6E32