You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test_enum=[1,2,3].to_enumapp_info"test_enum = #{test_enum.inspect}"current_test=test_enum.next# Ka-pow! Rhodes bombs!app_info"current_test = #{current_test.inspect}"# we do not get here
(Yes, I know I need an exception handler to detect the end when looping through. But no loop above. current_test should be set to 1.)
Works in Ruby 1.9.2-p290 (same version as Rhodes) on OSX desktop irb.
This is on iOS simulator. Need to test on device to see if it bombs there as well, and see if anything in system log.
The text was updated successfully, but these errors were encountered:
jtara
changed the title
Ruby Enumerator#next possibly broken iOS
Ruby Enumerator#next broken iOS
Nov 15, 2014
That's a discussion about jRuby. But it mentions an implementation detail of #next:
On the first call to #next, a fiber or generator is spun up to
start the call to each, similar to this:
f = Fiber.new { collection.each {|i| Fiber.yield i} }
For each element next returns, the fiber/generator is invoked to
produce the next result
def next
f.resume
end
When the enumeration completes (or at any time) you can rewind and
start from the beginning.
I'd guess that Rhodes doesn't implement Fibers.
If that's the case, Enumerator#next needs to be documented as not implemented.
I wonder what else in Ruby is depending on fibers?
Using Rhodes 5.0.2 (from RMS 5.0.2).
Enumerator#next
terminates app with no logging.(Yes, I know I need an exception handler to detect the end when looping through. But no loop above.
current_test
should be set to 1.)Works in Ruby 1.9.2-p290 (same version as Rhodes) on OSX desktop irb.
This is on iOS simulator. Need to test on device to see if it bombs there as well, and see if anything in system log.
The text was updated successfully, but these errors were encountered: