Skip to content

Instantly share code, notes, and snippets.

@rue
Created October 21, 2011 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rue/1303560 to your computer and use it in GitHub Desktop.
Save rue/1303560 to your computer and use it in GitHub Desktop.
foo = 5
Object.new.instance_eval "bar = 3; p local_variables, eval('local_variables'), eval('s = Rubinius::VariableScope.of_sender; [s.method, s.method.local_names, s.locals,s.parent]'), eval('bar'), eval('foo'), (s = Rubinius::VariableScope.of_sender; [s.method, s.method.local_names, s.parent])"
puts "------------"
Object.new.instance_eval { eval("bar = 3"); p local_variables, (s = Rubinius::VariableScope.of_sender; ['m', s.method, 'mln', s.method.local_names, 'sl', s.locals, 'sp', s.parent]), eval('bar'), eval('foo')}
p local_variables, eval("bar"), eval("foo")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment