amirrajan / rubymotion-applied

RubyMotion documentation provided by the community. Submit a pull request to the docs for a free one year indie subscription.
Apache License 2.0
49 stars 9 forks source link

Enumerator#next returns nil #86

Open ben5516 opened 6 years ago

ben5516 commented 6 years ago

NB: I also submitted a bug report through rubymotion.com.

Possibly related to https://github.com/amirrajan/rubymotion-applied/issues/71

In MRI Ruby you can do:

x = (1..10).to_enum
x.next # => 1
x.next # => 2
x.next # => 3

But in RM, the same thing gives you:

x = (1..10).to_enum
x.next # => nil
x.next # => nil
x.next # => nil

This seems to be the case with all enumerators.

x = [1, 2, 3].each
x.next # => nil