[Ironruby-core] IronRuby hosting: self becomes nil

Alex 2k8 lists at ruby-forum.com
Thu Jan 8 21:50:42 EST 2009


Hello,

I get very odd results with attached code:

- - -
#<System::Windows::Forms::Form:0x000005c>
nil
#<System::Windows::Forms::Form:0x000005e>
- - -

While was expected
- - -
#<System::Windows::Forms::Form:0x000005c>
#<System::Windows::Forms::Form:0x000005c>
#<System::Windows::Forms::Form:0x000005e>
- - -

The 'nil' is printed by this expression:
  form = form.test

and the test method definition is:

  class Object
    def test
      p self
    end
  end

The hint: 'form' variable was set by the script host (SetVariable).

I am using DLR-0.9.

Thanks,
- Alex

Attachments:
http://www.ruby-forum.com/attachment/3138/snippet.txt

-- 
Posted via http://www.ruby-forum.com/.


More information about the Ironruby-core mailing list