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

ruby-changes:14797

From: matz <ko1@a...>
Date: Sat, 13 Feb 2010 17:12:03 +0900 (JST)
Subject: [ruby-changes:14797] Ruby:r26659 (trunk): * array.c (rb_ary_delete): RDoc update. a patch from Hugh Sasse.

matz	2010-02-13 17:08:19 +0900 (Sat, 13 Feb 2010)

  New Revision: 26659

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

  Log:
    * array.c (rb_ary_delete): RDoc update.  a patch from Hugh Sasse.
      [ruby-core:28128]
    
    * array.c (rb_ary_compact_bang): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/array.c

Index: array.c
===================================================================
--- array.c	(revision 26658)
+++ array.c	(revision 26659)
@@ -2253,10 +2253,12 @@
  *     array.delete(obj)            -> obj or nil
  *     array.delete(obj) { block }  -> obj or nil
  *
- *  Deletes items from <i>self</i> that are equal to <i>obj</i>. If
+ *  Deletes items from <i>self</i> that are equal to <i>obj</i>.
+ *  If any items are found, returns <i>obj</i>.   If
  *  the item is not found, returns <code>nil</code>. If the optional
  *  code block is given, returns the result of <i>block</i> if the item
- *  is not found.
+ *  is not found.  (To remove <code>nil</code> elements and
+ *  get an informative return value, use #compact!)
  *
  *     a = [ "a", "b", "b", "b", "c" ]
  *     a.delete("b")                   #=> "b"
@@ -3384,7 +3386,8 @@
  *     array.compact!    ->   array  or  nil
  *
  *  Removes +nil+ elements from array.
- *  Returns +nil+ if no changes were made.
+ *  Returns +nil+ if no changes were made, otherwise return
+ *  </i>array</i>.
  *
  *     [ "a", nil, "b", nil, "c" ].compact! #=> [ "a", "b", "c" ]
  *     [ "a", "b", "c" ].compact!           #=> nil
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 26658)
+++ ChangeLog	(revision 26659)
@@ -1,3 +1,10 @@
+Sat Feb 13 17:07:20 2010  Yukihiro Matsumoto  <matz@r...>
+
+	* array.c (rb_ary_delete): RDoc update.  a patch from Hugh Sasse.
+	  [ruby-core:28128]
+
+	* array.c (rb_ary_compact_bang): ditto.
+
 Sat Feb 13 15:01:24 2010  Yukihiro Matsumoto  <matz@r...>
 
 	* marshal.c (id2encidx): duplicated entry for encoding name.

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

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