Skip to content

Instantly share code, notes, and snippets.

@teleological
Created April 29, 2011 13:38
Show Gist options
  • Save teleological/948305 to your computer and use it in GitHub Desktop.
Save teleological/948305 to your computer and use it in GitHub Desktop.
FFI internals 5
module Greeter
extend RubyInternals
iseq = RubyVM::InstructionSequence.compile <<-RUBY
puts "Hello, world."
RUBY
define_iseq_singleton_method(self, :greet, iseq)
end
Greeter.greet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment