[MacRuby] #817: External iterators returning nil
#817: External iterators returning nil -----------------------------------+---------------------------------------- Reporter: kennylovrin@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: -----------------------------------+---------------------------------------- Trying to use the "next" method of an external iterator showed the following problem: iMac:~ kenny$ macruby -v MacRuby 0.7 (ruby 1.9.2) [universal-darwin10.0, x86_64] iMac:~ kenny$ macirb irb(main):001:0> i = ["one", "two"].each => #<Enumerator:0x2000faa60> irb(main):002:0> i.next => nil irb(main):003:0> i.next => nil irb(main):004:0> iMac:~ kenny$ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] iMac:~ kenny$ irb
i = ["one", "two"].each => #<Enumerable::Enumerator:0x101270900> i.next => "one" i.next => "two"
As I understand, this is a defect as I haven't found any indications that it shouldn't work? -- Ticket URL: <http://www.macruby.org/trac/ticket/817> MacRuby <http://macruby.org/>
#817: External iterators returning nil -----------------------------------+---------------------------------------- Reporter: kennylovrin@… | Owner: lsansonetti@… Type: defect | Status: new Priority: minor | Milestone: Component: MacRuby | Keywords: -----------------------------------+---------------------------------------- Comment(by watson1978@…): It seems that the external iterator is not yet implemented.[[BR]] The external iterator is being disabled. [[BR]] enumerator.c:415 {{{ #if 0 static VALUE next_ii(VALUE i, VALUE obj, int argc, VALUE *argv) { rb_fiber_yield(argc, argv); return Qnil; } static VALUE next_i(VALUE curr, VALUE obj) { struct enumerator *e = enumerator_ptr(obj); VALUE rnil = Qnil; rb_block_call(obj, rb_intern("each"), 0, 0, next_ii, obj); e->no_next = Qtrue; return rb_fiber_yield(1, &rnil); } static void next_init(VALUE obj, struct enumerator *e) { VALUE curr = rb_fiber_current(); e->dst = curr; e->fib = rb_fiber_new(next_i, obj); } #endif }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/817#comment:1> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby