Joao Pedrosa wrote:
> Hi,
>
> dewd@heaven:~ $ ruby -v
> ruby 1.9.0 (2005-05-01) [i686-linux]
> dewd@heaven:~ $ irb
> irb(main):001:0> def opa s
> irb(main):002:1> 'z'
> irb(main):003:1> end
> => nil
> irb(main):004:0> opa 'kct'
> => "z"
> irb(main):005:0> opa = opa('kct')
> NoMethodError: undefined method `call' for nil:NilClass
>         from (irb):5
> irb(main):006:0> exit
> dewd@heaven:~ $
>
> I tested it on Windows and on Linux with Ruby CVS-HEAD:
> dewd@heaven:~ $ ruby -v
> ruby 1.9.0 (2005-05-01) [i686-linux]
>
> Is it on purpose? Because it breaks some code in at least a lib that I
> know of (in rakewx.rb from wxRuby).

Dunno...

Additional note: 1.8.2 doesn't show this behavior.  But: never trust IRB
when it comes to local variables.  Did you also try that in a script or
with ruby -e '...'?

Kind regards

    robert