[MacRuby-devel] [MacRuby] #812: Eval with binding is not able to retrieve local_variables
MacRuby
ruby-noreply at macosforge.org
Sun Jul 25 03:30:00 PDT 2010
#812: Eval with binding is not able to retrieve local_variables
-------------------------------------+--------------------------------------
Reporter: eloy.de.enige@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords: irb
-------------------------------------+--------------------------------------
{{{
$ cat t.rb
toplevel = :ok
p local_variables
p eval('local_variables', TOPLEVEL_BINDING)
b = Object.new.instance_eval { binding }
p b
eval('not_toplevel = :ok', b)
p eval('local_variables', b)
$ ruby19 t.rb
[:toplevel, :b]
[:toplevel, :b]
#<Binding:0x00000100864bf0>
[:not_toplevel, :toplevel, :b]
$ macruby t.rb
[:toplevel, :b]
[]
#<Binding:0x2000c5ea0>
[]
}}}
This is needed by dietrb in order to complete lvars or methods on a lvar.
--
Ticket URL: <http://www.macruby.org/trac/ticket/812>
MacRuby <http://macruby.org/>
More information about the MacRuby-devel
mailing list