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

ruby-changes:61399

From: Masataka <ko1@a...>
Date: Wed, 27 May 2020 15:49:00 +0900 (JST)
Subject: [ruby-changes:61399] a3f498e44c (master): Fix max, min, minmax documentation (#3131)

https://git.ruby-lang.org/ruby.git/commit/?id=a3f498e44c

From a3f498e44c767b331ed07e24f1ce7841b515cba0 Mon Sep 17 00:00:00 2001
From: Masataka Pocke Kuwabara <kuwabara@p...>
Date: Wed, 27 May 2020 15:48:46 +0900
Subject: Fix max, min, minmax documentation (#3131)

They only need that all objects implement <=>,
but the documentation said it needs Comparable.

diff --git a/array.c b/array.c
index e5de084..0bf5c15 100644
--- a/array.c
+++ b/array.c
@@ -4932,7 +4932,7 @@ rb_ary_union_multi(int argc, VALUE *argv, VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L4932
  *     ary.max(n) {|a, b| block}   -> array
  *
  *  Returns the object in _ary_ with the maximum value. The
- *  first form assumes all objects implement Comparable;
+ *  first form assumes all objects implement <code><=></code>;
  *  the second uses the block to return <em>a <=> b</em>.
  *
  *     ary = %w(albatross dog horse)
@@ -4985,7 +4985,7 @@ rb_ary_max(int argc, VALUE *argv, VALUE ary) https://github.com/ruby/ruby/blob/trunk/array.c#L4985
  *     ary.min(n) {| a,b | block } -> array
  *
  *  Returns the object in _ary_ with the minimum value. The
- *  first form assumes all objects implement Comparable;
+ *  first form assumes all objects implement <code><=></code>;
  *  the second uses the block to return <em>a <=> b</em>.
  *
  *     ary = %w(albatross dog horse)
diff --git a/enum.c b/enum.c
index 89bbd50..3cddbc0 100644
--- a/enum.c
+++ b/enum.c
@@ -1763,7 +1763,7 @@ min_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, args)) https://github.com/ruby/ruby/blob/trunk/enum.c#L1763
  *     enum.min(n) { |a, b| block } -> array
  *
  *  Returns the object in _enum_ with the minimum value. The
- *  first form assumes all objects implement Comparable;
+ *  first form assumes all objects implement <code><=></code>;
  *  the second uses the block to return <em>a <=> b</em>.
  *
  *     a = %w(albatross dog horse)
@@ -1855,7 +1855,7 @@ max_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, args)) https://github.com/ruby/ruby/blob/trunk/enum.c#L1855
  *     enum.max(n) { |a, b| block } -> array
  *
  *  Returns the object in _enum_ with the maximum value. The
- *  first form assumes all objects implement Comparable;
+ *  first form assumes all objects implement <code><=></code>;
  *  the second uses the block to return <em>a <=> b</em>.
  *
  *     a = %w(albatross dog horse)
@@ -2014,7 +2014,7 @@ minmax_ii(RB_BLOCK_CALL_FUNC_ARGLIST(i, _memo)) https://github.com/ruby/ruby/blob/trunk/enum.c#L2014
  *
  *  Returns a two element array which contains the minimum and the
  *  maximum value in the enumerable.  The first form assumes all
- *  objects implement Comparable; the second uses the
+ *  objects implement <code><=></code>; the second uses the
  *  block to return <em>a <=> b</em>.
  *
  *     a = %w(albatross dog horse)
-- 
cgit v0.10.2


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

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