Created
June 14, 2011 09:18
-
-
Save banister/1024566 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
pry(main)> show-method for_ | |
From: (pry) @ line 0: | |
Number of lines: 6 | |
def for_(var, cond, inc) | |
while(cond.call) | |
yield var | |
inc.call | |
end | |
end | |
pry(main)> for_(j=0, ->{j<3}, ->{j+=1}) { puts j } | |
0 | |
1 | |
2 | |
=> nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment