Created
December 1, 2013 20:24
-
-
Save keeran/7740224 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
>> i = a.each | |
=> #<Enumerator: [1, 2, 3]:each> | |
>> loop do | |
?> puts i.next | |
>> end | |
1 | |
2 | |
3 | |
=> nil | |
>> i = a.each | |
=> #<Enumerator: [1, 2, 3]:each> | |
>> while true | |
>> puts i.next | |
>> end | |
1 | |
2 | |
3 | |
StopIteration: iteration reached an end | |
from (irb):18:in `next' | |
from (irb):18 | |
from /Users/keeran/.rvm/rubies/ruby-1.9.3-p448/bin/irb:12:in `<main>' | |
>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment