Project

General

Profile

Bug #6053

Enumerator#rewind goes to beginning instead of decrementing one step.

Added by tyre77 (Chris Maddox) over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
ruby -v:
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.3.0]
[ruby-core:42767]

Description

From the ruby docs:
rewind → e
Rewinds the enumeration sequence by one step.

In practice, however, it fully rewinds (either change documentation or have it do what it says. Going back one step is nice though):
irb(main):001:0> a = [1,2,3,4]
=> [1, 2, 3, 4]
irb(main):002:0> b = a.to_enum
=> #
irb(main):007:0> b.next
=> 1
irb(main):008:0> b.next
=> 2
irb(main):009:0> b.next
=> 3
irb(main):010:0> b.rewind
=> #
irb(main):011:0> b.next
=> 1

Associated revisions

Revision 3052f75d
Added by matz (Yukihiro Matsumoto) over 6 years ago

  • enumerator.c (enumerator_rewind): update the documentation. fixed: #6053

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 34712
Added by matz (Yukihiro Matsumoto) over 6 years ago

  • enumerator.c (enumerator_rewind): update the documentation. fixed: #6053

Revision 34712
Added by matz (Yukihiro Matsumoto) over 6 years ago

  • enumerator.c (enumerator_rewind): update the documentation. fixed: #6053

Revision 34712
Added by matz (Yukihiro Matsumoto) over 6 years ago

  • enumerator.c (enumerator_rewind): update the documentation. fixed: #6053

Revision 34712
Added by matz (Yukihiro Matsumoto) over 6 years ago

  • enumerator.c (enumerator_rewind): update the documentation. fixed: #6053

Revision 34712
Added by matz (Yukihiro Matsumoto) over 6 years ago

  • enumerator.c (enumerator_rewind): update the documentation. fixed: #6053

Revision a81a8172
Added by marcandre (Marc-Andre Lafortune) over 6 years ago

merge revision(s) 34712:

    * enumerator.c (enumerator_rewind): update the documentation.
      fixed: #6053

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

History

#1 [ruby-core:42769] Updated by matz (Yukihiro Matsumoto) over 6 years ago

It is a bug in documentation. #rewind method rewinds the sequence to the beginning.

#2 Updated by matz (Yukihiro Matsumoto) over 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r34712.
Chris, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • enumerator.c (enumerator_rewind): update the documentation. fixed: #6053

Also available in: Atom PDF