Created
December 22, 2010 15:33
-
-
Save alindeman/751651 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
array = [1, 2, 3, 4, 5] | |
print_procs = [] | |
array.each do |i| | |
print_procs.push lambda { puts i } | |
end | |
print_procs.each(&:call) | |
puts | |
print_procs = [] | |
for i in array | |
print_procs.push lambda { puts i } | |
end | |
print_procs.each(&:call) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment