Created
December 9, 2019 04:04
-
-
Save ethe/cad17be3abf81935f61f20bd2937fc5c 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
def foo | |
cnt = 0 | |
return lambda { | |
cnt += 1 | |
return cnt | |
} | |
end | |
func = foo | |
puts func.call | |
puts func.call | |
puts func.call |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment