Skip to content

Instantly share code, notes, and snippets.

@jimweirich
Created November 5, 2013 03:51
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jimweirich/7313596 to your computer and use it in GitHub Desktop.
Save jimweirich/7313596 to your computer and use it in GitHub Desktop.
What does the following print? I was surprised. (Actually, I was surprised it was legal syntax.)
def foo(a=:default, b)
puts "a=#{a}, b=#{b}"
end
foo(:value)
foo(:x, :y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment