Created
May 29, 2012 02:41
-
-
Save naohaq/2822220 to your computer and use it in GitHub Desktop.
Top level local variable in Ruby
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
load "foo.rb" | |
puts a # Error! | |
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
def foo | |
puts a # Error! | |
end | |
a = 1 | |
# This is ok. | |
puts a | |
# # This causes an error. | |
# foo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yay Ruby!!