Project

General

Profile

Bug #7493 » CRuby1.8.7.rb

CRuby-1.8.7 - kachick (Kenichi Kamiya), 12/02/2012 01:35 PM

 
# * ruby 1.8.7 (2012-10-12 patchlevel 371) [x86_64-linux]

array = [:a, :b, :c]

index_enum = array.index
index_enum.to_a #=> [:a, :b, :c]
index_enum.next #=> :a
index_enum.next #=> StopIteration: iteration reached at end
index_enum.next

find_index_enum = array.find_index
find_index_enum.to_a #=> [:a, :b, :c]
find_index_enum.next #=> :a
find_index_enum.next #=> StopIteration: iteration reached at end
find_index_enum.next

rindex_enum = array.rindex
rindex_enum.to_a #=> [:c, :b, :a]
rindex_enum.next #=> :c
rindex_enum.next #=> StopIteration: iteration reached at end
rindex_enum.next

find_enum = array.find
find_enum.to_a #=> [:a, :b, :c]
find_enum.next #=> :a
find_enum.next #=> StopIteration: iteration reached at end
find_enum.next

detect_enum = array.detect
detect_enum.to_a #=> [:a, :b, :c]
detect_enum.next #=> :a
detect_enum.next #=> StopIteration: iteration reached at end
detect_enum.next
(1-1/2)