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

ruby-changes:1765

From: ko1@a...
Date: 25 Aug 2007 09:43:24 +0900
Subject: [ruby-changes:1765] matz - Ruby:r13256 (trunk): * array.c (rb_ary_s_try_convert): more document description.

matz	2007-08-25 09:43:13 +0900 (Sat, 25 Aug 2007)

  New Revision: 13256

  Modified files:
    trunk/ChangeLog
    trunk/array.c
    trunk/re.c

  Log:
    * array.c (rb_ary_s_try_convert): more document description.
    
    * re.c (rb_reg_s_try_convert): typo fixed.

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/array.c?r1=13256&r2=13255
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13256&r2=13255
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/re.c?r1=13256&r2=13255

Index: array.c
===================================================================
--- array.c	(revision 13255)
+++ array.c	(revision 13256)
@@ -249,11 +249,20 @@
  *
  *  Try to convert <i>obj</i> into an array, using to_ary method.
  *  Returns converted array or nil if <i>obj</i> cannot be converted
- *  for any reason.
+ *  for any reason.  This method is to check if an argument is an
+ *  array.  
  *
  *     Array.try_convert([1])   # => [1]
  *     Array.try_convert("1")   # => nil
+ *     
+ *     if tmp = Array.try_convert(arg)
+ *       # the argument is an array
+ *     elsif tmp = String.try_convert(arg)
+ *       # the argument is a string
+ *     end
+ *
  */
+
 static VALUE
 rb_ary_s_try_convert(VALUE dummy, VALUE ary)
 {
Index: re.c
===================================================================
--- re.c	(revision 13255)
+++ re.c	(revision 13256)
@@ -2042,8 +2042,8 @@
  *  Returns converted regexp or nil if <i>obj</i> cannot be converted
  *  for any reason.
  *
- *     IO.try_convert(/re/)      # => /re/
- *     IO.try_convert("re")      # => nil
+ *     Regexp.try_convert(/re/)      # => /re/
+ *     Regexp.try_convert("re")      # => nil
  */
 static VALUE
 rb_reg_s_try_convert(VALUE dummy, VALUE re)
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 13255)
+++ ChangeLog	(revision 13256)
@@ -1,3 +1,9 @@
+Sat Aug 25 09:39:50 2007  Yukihiro Matsumoto  <matz@r...>
+
+	* array.c (rb_ary_s_try_convert): more document description.
+
+	* re.c (rb_reg_s_try_convert): typo fixed.
+
 Sat Aug 25 08:54:12 2007  Koichi Sasada  <ko1@a...>
 
 	* id.h, id.c: remove idFuncall.

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

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