Skip to content

Instantly share code, notes, and snippets.

@Twisol
Created December 4, 2010 02:56
Show Gist options
  • Save Twisol/727863 to your computer and use it in GitHub Desktop.
Save Twisol/727863 to your computer and use it in GitHub Desktop.
class Lupin::Test
dynamic_method :foo do |g|
ast = Lupin::Parser.parse("1+4- -10", :root => :expression).value
Lupin::Compiler.compile(ast, g)
g.ret
end
end
puts Lupin::Test.new.foo #=> 15.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment