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

ruby-changes:52970

From: stomar <ko1@a...>
Date: Sat, 20 Oct 2018 06:27:20 +0900 (JST)
Subject: [ruby-changes:52970] stomar:r65184 (trunk): array.c: improve docs for Array#difference

stomar	2018-10-20 06:26:15 +0900 (Sat, 20 Oct 2018)

  New Revision: 65184

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

  Log:
    array.c: improve docs for Array#difference
    
    * array.c: [DOC] small doc fixes for Array#difference and Array#-.

  Modified files:
    trunk/array.c
Index: array.c
===================================================================
--- array.c	(revision 65183)
+++ array.c	(revision 65184)
@@ -4189,7 +4189,7 @@ ary_recycle_hash(VALUE hash) https://github.com/ruby/ruby/blob/trunk/array.c#L4189
  *
  *  If you need set-like behavior, see the library class Set.
  *
- *  See Array#difference.
+ *  See also Array#difference.
  */
 
 static VALUE
@@ -4222,22 +4222,22 @@ rb_ary_diff(VALUE ary1, VALUE ary2) https://github.com/ruby/ruby/blob/trunk/array.c#L4222
 
 /*
  *  call-seq:
- *     ary.difference(other_ary1, other_ary2,...)   -> ary
+ *     ary.difference(other_ary1, other_ary2, ...)   -> ary
  *
  *  Array Difference
  *
- *  Returns a new array that is a copy of +self+, removing any items
- *  that also appear in any of the <code>other_ary</code>s. The order of +self+ is
- *  preserved.
+ *  Returns a new array that is a copy of the receiver, removing any items
+ *  that also appear in any of the arrays given as arguments.
+ *  The order is preserved from the original array.
  *
  *  It compares elements using their #hash and #eql? methods for efficiency.
  *
- *     [ 1, 1, 2, 2, 3, 3, 4, 5 ].difference([ 1, 2, 4 ])       #=> [ 3, 3, 5 ]
- *     [ 1, 'c', :s, 'yep' ].difference([ 1 ], [ 'a', 'c' ])    #=> [:s, "yep"]
+ *     [ 1, 1, 2, 2, 3, 3, 4, 5 ].difference([ 1, 2, 4 ])     #=> [ 3, 3, 5 ]
+ *     [ 1, 'c', :s, 'yep' ].difference([ 1 ], [ 'a', 'c' ])  #=> [ :s, "yep" ]
  *
  *  If you need set-like behavior, see the library class Set.
  *
- *  See Array#-.
+ *  See also Array#-.
  */
 
 static VALUE

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

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