Skip to content

Instantly share code, notes, and snippets.

@dwarring
Created September 29, 2013 23:46
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 dwarring/6757601 to your computer and use it in GitHub Desktop.
Save dwarring/6757601 to your computer and use it in GitHub Desktop.
# In the following Ruby code `xx -5` is treated as a method call,
# `yy -5` as an arithmetic expression.
#
def xx(n) ; 37 - n; end
puts xx -5 # output is 42
yy = 37
puts yy -5 # output is 32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment