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

ruby-changes:52436

From: nobu <ko1@a...>
Date: Thu, 6 Sep 2018 05:40:53 +0900 (JST)
Subject: [ruby-changes:52436] nobu:r64645 (trunk): enumerator.c: [DOC] Enumerator::Lazy#force [ci skip]

nobu	2018-09-06 05:40:49 +0900 (Thu, 06 Sep 2018)

  New Revision: 64645

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64645

  Log:
    enumerator.c: [DOC] Enumerator::Lazy#force [ci skip]
    
    added documentation of Enumerator::Lazy#force, just to clarify that it
    is an alias of an inherited method.  [ruby-core:88872] [Bug #15079]

  Modified files:
    trunk/enumerator.c
Index: enumerator.c
===================================================================
--- enumerator.c	(revision 64644)
+++ enumerator.c	(revision 64645)
@@ -1613,6 +1613,20 @@ lazy_initialize(int argc, VALUE *argv, V https://github.com/ruby/ruby/blob/trunk/enumerator.c#L1613
     return self;
 }
 
+#if 0 /* for RDoc */
+/*
+ * call-seq:
+ *   lazy.to_a  -> array
+ *   lazy.force -> array
+ *
+ * Expands +lazy+ enumerator to an array.
+ * See Enumerable#to_a.
+ */
+static VALUE lazy_to_a(VALUE self)
+{
+}
+#endif
+
 static void
 lazy_set_args(VALUE lazy, VALUE args)
 {
@@ -2833,6 +2847,9 @@ InitVM_Enumerator(void) https://github.com/ruby/ruby/blob/trunk/enumerator.c#L2847
     rb_define_method(rb_cLazy, "chunk_while", lazy_super, -1);
     rb_define_method(rb_cLazy, "uniq", lazy_uniq, 0);
 
+#if 0 /* for RDoc */
+    rb_define_method(rb_cLazy, "to_a", lazy_to_a, 0);
+#endif
     rb_define_alias(rb_cLazy, "force", "to_a");
 
     rb_eStopIteration = rb_define_class("StopIteration", rb_eIndexError);

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

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