Skip to content

Instantly share code, notes, and snippets.

@burke
Forked from snoble/gist:4365689
Last active December 10, 2015 02:09
Show Gist options
  • Save burke/4365977 to your computer and use it in GitHub Desktop.
Save burke/4365977 to your computer and use it in GitHub Desktop.
def foo(x); 99; end
a = foo (44) / 11
foo = 99999999
b = foo (44) / 11
puts "a: #{a} b: #{b}" #output of "a: 99 b: 9"
# s(:defn, :foo, s(:args, :x), s(:lit, 99)),
# s(:lasgn, :a, s(:call, nil, :foo, s(:call, s(:lit, 44), :/, s(:lit, 11)))),
# s(:lasgn, :foo, s(:lit, 99999999)),
# s(:lasgn, :b, s(:call, s(:call, nil, :foo, s(:lit, 44)), :/, s(:lit, 11))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment