[前][次][番号順一覧][スレッド一覧]

ruby-changes:13416

From: knu <ko1@a...>
Date: Fri, 2 Oct 2009 20:02:45 +0900 (JST)
Subject: [ruby-changes:13416] Ruby:r25186 (ruby_1_8): Improve rdoc for Enumerator#next. Remove a not-so-notable note.

knu	2009-10-02 20:02:35 +0900 (Fri, 02 Oct 2009)

  New Revision: 25186

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25186

  Log:
    Improve rdoc for Enumerator#next.  Remove a not-so-notable note.

  Modified files:
    branches/ruby_1_8/lib/generator.rb

Index: ruby_1_8/lib/generator.rb
===================================================================
--- ruby_1_8/lib/generator.rb	(revision 25185)
+++ ruby_1_8/lib/generator.rb	(revision 25186)
@@ -178,16 +178,12 @@
   #   e.next   => object
   #
   # Returns the next object in the enumerator, and move the internal
-  # position forward.  When the position reached at the end, internal
+  # position forward.  When the position reaches at the end, internal
   # position is rewound then StopIteration is raised.
   #
-  # Note that enumeration sequence by next method does not affect other
-  # non-external enumeration methods, unless underlying iteration
-  # methods itself has side-effect, e.g. IO#each_line.
-  #
-  # Caution: This feature internally uses Generator, which uses callcc
-  # to stop and resume enumeration to fetch each value.  Use with care
-  # and be aware of the performance loss.
+  # Caution: This method is slow.  It is implemented using the
+  # Generator library which uses callcc to stop and resume an "each"
+  # method to fetch values one by one.
   def next
     g = __generator
     return g.next unless g.end?

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]