Skip to content

Instantly share code, notes, and snippets.

@jgouly
Created March 24, 2011 18:43
Show Gist options
  • Save jgouly/885599 to your computer and use it in GitHub Desktop.
Save jgouly/885599 to your computer and use it in GitHub Desktop.
#!/usr/bin/env rbx
class Code; end
g = Rubinius::Generator.new
g.name = :call
g.file = :"repl"
g.set_line 1
g.push_int 1
g.push_const :Kernel
g.allow_private
g.send_stack :p, 1
g.ret
g.close
g.encode
cm = g.package ::Rubinius::CompiledMethod
puts cm.decode
code = Code.new
ss = ::Rubinius::StaticScope.new Object
::Rubinius.attach_method g.name, cm, ss, code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment