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

ruby-changes:13730

From: marcandre <ko1@a...>
Date: Wed, 28 Oct 2009 13:50:22 +0900 (JST)
Subject: [ruby-changes:13730] Ruby:r25522 (trunk): * string.c: rdoc for <=>, casecmp

marcandre	2009-10-28 13:50:09 +0900 (Wed, 28 Oct 2009)

  New Revision: 25522

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

  Log:
    * string.c: rdoc for <=>, casecmp
    
    * bignum.c: rdoc for <=>
    
    * file.c: ditto
    
    * time.c: ditto
    
    * compar.c: rdoc

  Modified files:
    trunk/array.c
    trunk/bignum.c
    trunk/compar.c
    trunk/file.c
    trunk/string.c
    trunk/time.c

Index: array.c
===================================================================
--- array.c	(revision 25521)
+++ array.c	(revision 25522)
@@ -2963,7 +2963,7 @@
 
 /*
  *  call-seq:
- *     array <=> other_array   ->  -1, 0, +1, nil
+ *     array <=> other_array   ->  -1, 0, +1 or nil
  *
  *  Comparison---Returns an integer (-1, 0,
  *  or +1) if this array is less than, equal to, or greater than
Index: time.c
===================================================================
--- time.c	(revision 25521)
+++ time.c	(revision 25522)
@@ -2489,7 +2489,7 @@
 
 /*
  *  call-seq:
- *     time <=> other_time => -1, 0, +1
+ *     time <=> other_time => -1, 0, +1 or nil
  *
  *  Comparison---Compares <i>time</i> with <i>other_time</i>.
  *
Index: string.c
===================================================================
--- string.c	(revision 25521)
+++ string.c	(revision 25522)
@@ -2162,7 +2162,7 @@
 
 /*
  *  call-seq:
- *     str <=> other_str   => -1, 0, +1
+ *     str <=> other_str   => -1, 0, +1 or nil
  *
  *  Comparison---Returns -1 if <i>other_str</i> is greater than, 0 if
  *  <i>other_str</i> is equal to, and +1 if <i>other_str</i> is less than
@@ -2213,7 +2213,7 @@
 
 /*
  *  call-seq:
- *     str.casecmp(other_str)   => -1, 0, +1
+ *     str.casecmp(other_str)   => -1, 0, +1 or nil
  *
  *  Case-insensitive version of <code>String#<=></code>.
  *
@@ -7161,7 +7161,7 @@
 /*
  * call-seq:
  *
- *   str <=> other       => -1, 0, +1
+ *   str <=> other       => -1, 0, +1 or nil
  *
  * Compares _sym_ with _other_ in string form.
  */
@@ -7178,7 +7178,7 @@
 /*
  * call-seq:
  *
- *   sym.casecmp(other)  => -1, 0, +1
+ *   sym.casecmp(other)  => -1, 0, +1 or nil
  *
  * Case-insensitive version of <code>Symbol#<=></code>.
  */
Index: compar.c
===================================================================
--- compar.c	(revision 25521)
+++ compar.c	(revision 25522)
@@ -163,7 +163,9 @@
  *  may be ordered. The class must define the <code><=></code> operator,
  *  which compares the receiver against another object, returning -1, 0,
  *  or +1 depending on whether the receiver is less than, equal to, or
- *  greater than the other object. <code>Comparable</code> uses
+ *  greater than the other object. If the other object is not comparable
+ *  then the <code><=></code> operator should return nil.
+ *  <code>Comparable</code> uses
  *  <code><=></code> to implement the conventional comparison operators
  *  (<code><</code>, <code><=</code>, <code>==</code>, <code>>=</code>,
  *  and <code>></code>) and the method <code>between?</code>.
Index: bignum.c
===================================================================
--- bignum.c	(revision 25521)
+++ bignum.c	(revision 25522)
@@ -1273,7 +1273,7 @@
 
 /*
  *  call-seq:
- *     big <=> numeric   => -1, 0, +1
+ *     big <=> numeric   => -1, 0, +1 or nil
  *
  *  Comparison---Returns -1, 0, or +1 depending on whether <i>big</i> is
  *  less than, equal to, or greater than <i>numeric</i>. This is the
Index: file.c
===================================================================
--- file.c	(revision 25521)
+++ file.c	(revision 25522)
@@ -223,7 +223,7 @@
 
 /*
  *  call-seq:
- *     stat <=> other_stat    => -1, 0, 1
+ *     stat <=> other_stat    => -1, 0, 1, nil
  *
  *  Compares <code>File::Stat</code> objects by comparing their
  *  respective modification times.

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

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