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

ruby-changes:13731

From: marcandre <ko1@a...>
Date: Wed, 28 Oct 2009 14:01:40 +0900 (JST)
Subject: [ruby-changes:13731] Ruby:r25523 (ruby_1_8): * time.c: rdoc fix for <=>

marcandre	2009-10-28 14:01:29 +0900 (Wed, 28 Oct 2009)

  New Revision: 25523

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

  Log:
    * time.c: rdoc fix for <=>
    
    * array.c: ditto
    
    * bignum.c: ditto
    
    * compar.c: ditto
    
    * file.c: ditto
    
    * numeric.c: ditto
    
    * string.c: rdoc fix for <=> and casecmp

  Modified files:
    branches/ruby_1_8/array.c
    branches/ruby_1_8/bignum.c
    branches/ruby_1_8/compar.c
    branches/ruby_1_8/file.c
    branches/ruby_1_8/numeric.c
    branches/ruby_1_8/string.c
    branches/ruby_1_8/time.c

Index: ruby_1_8/array.c
===================================================================
--- ruby_1_8/array.c	(revision 25522)
+++ ruby_1_8/array.c	(revision 25523)
@@ -2823,7 +2823,7 @@
 
 /*
  *  call-seq:
- *     array <=> other_array   ->  -1, 0, +1
+ *     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: ruby_1_8/time.c
===================================================================
--- ruby_1_8/time.c	(revision 25522)
+++ ruby_1_8/time.c	(revision 25523)
@@ -950,12 +950,9 @@
 
 /*
  *  call-seq:
- *     time <=> other_time => -1, 0, +1
- *     time <=> numeric    => -1, 0, +1
+ *     time <=> other_time => -1, 0, +1 or nil
  *
- *  Comparison---Compares <i>time</i> with <i>other_time</i> or with
- *  <i>numeric</i>, which is the number of seconds (possibly
- *  fractional) since epoch.
+ *  Comparison---Compares <i>time</i> with <i>other_time</i>.
  *
  *     t = Time.now       #=> Wed Apr 09 08:56:03 CDT 2003
  *     t2 = t + 2592000   #=> Fri May 09 08:56:03 CDT 2003
Index: ruby_1_8/numeric.c
===================================================================
--- ruby_1_8/numeric.c	(revision 25522)
+++ ruby_1_8/numeric.c	(revision 25523)
@@ -914,7 +914,7 @@
 
 /*
  *  call-seq:
- *     flt <=> numeric   => -1, 0, +1
+ *     flt <=> numeric   => -1, 0, +1 or nil
  *
  *  Returns -1, 0, or +1 depending on whether <i>flt</i> is less than,
  *  equal to, or greater than <i>numeric</i>. This is the basis for the
@@ -2423,7 +2423,7 @@
 
 /*
  *  call-seq:
- *     fix <=> numeric    => -1, 0, +1
+ *     fix <=> numeric    => -1, 0, +1 or nil
  *
  *  Comparison---Returns -1, 0, or +1 depending on whether <i>fix</i> is
  *  less than, equal to, or greater than <i>numeric</i>. This is the
Index: ruby_1_8/compar.c
===================================================================
--- ruby_1_8/compar.c	(revision 25522)
+++ ruby_1_8/compar.c	(revision 25523)
@@ -196,7 +196,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: ruby_1_8/string.c
===================================================================
--- ruby_1_8/string.c	(revision 25522)
+++ ruby_1_8/string.c	(revision 25523)
@@ -1031,7 +1031,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
@@ -1085,7 +1085,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>.
  *
Index: ruby_1_8/bignum.c
===================================================================
--- ruby_1_8/bignum.c	(revision 25522)
+++ ruby_1_8/bignum.c	(revision 25523)
@@ -986,7 +986,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: ruby_1_8/file.c
===================================================================
--- ruby_1_8/file.c	(revision 25522)
+++ ruby_1_8/file.c	(revision 25523)
@@ -187,7 +187,7 @@
 
 /*
  *  call-seq:
- *     stat <=> other_stat    => -1, 0, 1
+ *     stat <=> other_stat    => -1, 0, +1 or nil
  *
  *  Compares <code>File::Stat</code> objects by comparing their
  *  respective modification times.

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

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