-
-
Save mmalecki/7633977555958fa117a1 to your computer and use it in GitHub Desktop.
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
@var g = 1 | |
func0 () { | |
print(g) // what will it print? | |
} | |
func1 () { | |
@var g = 2 | |
print(g) // what will it print? | |
} | |
func2 (g) { | |
print(g) | |
} | |
func2(3) // what will it print? |
indutny
commented
Mar 10, 2012
- nil
- change to @g = 2, and it'll return 2
- 3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment