Projects

Ticket #298 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

macirb loses track of local variables

Reported by: mharper@… Owned by: lsansonetti@…
Priority: major Milestone: MacRuby 0.5
Component: MacRuby Keywords:
Cc:

Description

macirb loses track of local variables.

After a clean test and install of the latest experimental branch on Snow Leopard (10A411), I fired up macirb for a quick test. macirb starts fine and gives me a prompt. But when I create a simple local variable and assign a string value to it, then try printing the variable, macirb throws an exception:

mharper$ macirb irb: warn: can't alias exit from irb_exit. irb(main):001:0> a = "hello" => "hello" irb(main):002:0> puts a NameError: undefined local variable or method `a' for main:TopLevel

from 0:in `eval:' from 0:in `evaluate:' from 0:in `evaluate:' from 0:in `signal_status:' from 0:in `each_top_level_statement' from 0:in `eval_input' from 0:in `start:'

irb(main):003:0> exit

macirb -v => irb 0.9.5(05/04/13)

Change History

Changed 3 years ago by conradwt@…

This also happens on Snow Leopard Build (10A402a). For example,

darnoc-laptop:etc conradwt$ macirb irb: warn: can't alias exit from irb_exit. irb(main):001:0> a = "This is a test" => "This is a test" irb(main):002:0> puts a NameError: undefined local variable or method `a' for main:TopLevel

from 0:in `eval:' from 0:in `evaluate:' from 0:in `evaluate:' from 0:in `signal_status:' from 0:in `each_top_level_statement' from 0:in `eval_input' from 0:in `start:'

Changed 3 years ago by lsansonetti@…

For a strange reason you can't assign a local variable in the very first expression. It works for further expressions though.

I did not investigate yet the reason of this bug, if anyone wants to have a look at it and extract the problem into a code snippet, it would be super helpful!

macirb is still very buggy right now on experimental and needs more love :)

Changed 2 years ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to MacRuby 0.5

This should be fixed in trunk since a few weeks. There are still a couple of bugs related to Binding, but at least local variables should work.

Note: See TracTickets for help on using tickets.