ruby-cvs:20141
From: matz ruby-lang.org
Date: Wed, 8 Aug 2007 16:07:04 +0900 (JST)
Subject: [ruby-cvs:20141] Ruby:r12905 (trunk): * enumerator.c (enumerator_next_p): should check correctly even when
matz 2007-08-08 16:07:03 +0900 (Wed, 08 Aug 2007)
New Revision: 12905
Modified files:
trunk/ChangeLog
trunk/enum.c
trunk/enumerator.c
trunk/include/ruby/ruby.h
trunk/test/ruby/test_iterator.rb
Log:
* enumerator.c (enumerator_next_p): should check correctly even when
e.next has not been called before.
* enumerator.c (enumerator_next): raise StopIteration (name taken
from Python) instead of IndexError.
* enum.c (enum_zip): catch StopIteration exception.
* enumerator.c (enumerator_with_index): return Enumerator if no
block is given.
* test/ruby/test_iterator.rb (TestIterator::test_enumerator): add
test for enumerators.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_iterator.rb?r1=12905&r2=12904
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/include/ruby/ruby.h?r1=12905&r2=12904
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=12905&r2=12904
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/enum.c?r1=12905&r2=12904
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/enumerator.c?r1=12905&r2=12904