Skip to content

Instantly share code, notes, and snippets.

@jamezpolley
Created October 8, 2012 17:53
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 jamezpolley/3853899 to your computer and use it in GitHub Desktop.
Save jamezpolley/3853899 to your computer and use it in GitHub Desktop.
Reason #17 ruby made me cry this morning
jpolley@jpl:waldo$cat test.rb
#!/usr/bin/env ruby
def myfunc(a=1, b=3)
puts a
puts b
end
myfunc(b=2)
puts b
puts a
jpolley@jpl:waldo$./test.rb
2
3
2
./test.rb:10: undefined local variable or method `a' for main:Object (NameError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment