Created
October 8, 2012 17:53
-
-
Save jamezpolley/3853899 to your computer and use it in GitHub Desktop.
Reason #17 ruby made me cry this morning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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