From ea1b7a95777fb5ca231dbc54c38d3b5fb61abd19 Mon Sep 17 00:00:00 2001 From: marcandre Date: Wed, 28 Oct 2009 05:01:29 +0000 Subject: [PATCH] * 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- array.c | 2 +- bignum.c | 2 +- compar.c | 4 +++- file.c | 2 +- numeric.c | 4 ++-- string.c | 4 ++-- time.c | 7 ++----- 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/array.c b/array.c index b7be69afd6..172bf4914d 100644 --- a/array.c +++ b/array.c @@ -2823,7 +2823,7 @@ recursive_cmp(ary1, ary2, recur) /* * 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 diff --git a/bignum.c b/bignum.c index 473381b215..8f6c845ead 100644 --- a/bignum.c +++ b/bignum.c @@ -986,7 +986,7 @@ rb_big_to_f(x) /* * call-seq: - * big <=> numeric => -1, 0, +1 + * big <=> numeric => -1, 0, +1 or nil * * Comparison---Returns -1, 0, or +1 depending on whether big is * less than, equal to, or greater than numeric. This is the diff --git a/compar.c b/compar.c index 8f3f83e40e..3903ec32d1 100644 --- a/compar.c +++ b/compar.c @@ -196,7 +196,9 @@ cmp_between(x, min, max) * may be ordered. The class must define the <=> 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. Comparable uses + * greater than the other object. If the other object is not comparable + * then the <=> operator should return nil. + * Comparable uses * <=> to implement the conventional comparison operators * (<, <=, ==, >=, * and >) and the method between?. diff --git a/file.c b/file.c index 9e36a10386..53452526bd 100644 --- a/file.c +++ b/file.c @@ -187,7 +187,7 @@ get_stat(self) /* * call-seq: - * stat <=> other_stat => -1, 0, 1 + * stat <=> other_stat => -1, 0, +1 or nil * * Compares File::Stat objects by comparing their * respective modification times. diff --git a/numeric.c b/numeric.c index 0936c6916f..957cf7b0e6 100644 --- a/numeric.c +++ b/numeric.c @@ -914,7 +914,7 @@ rb_dbl_cmp(a, b) /* * call-seq: - * flt <=> numeric => -1, 0, +1 + * flt <=> numeric => -1, 0, +1 or nil * * Returns -1, 0, or +1 depending on whether flt is less than, * equal to, or greater than numeric. This is the basis for the @@ -2423,7 +2423,7 @@ fix_equal(x, y) /* * call-seq: - * fix <=> numeric => -1, 0, +1 + * fix <=> numeric => -1, 0, +1 or nil * * Comparison---Returns -1, 0, or +1 depending on whether fix is * less than, equal to, or greater than numeric. This is the diff --git a/string.c b/string.c index fe7516892b..924b5e3c92 100644 --- a/string.c +++ b/string.c @@ -1031,7 +1031,7 @@ rb_str_eql(str1, str2) /* * call-seq: - * str <=> other_str => -1, 0, +1 + * str <=> other_str => -1, 0, +1 or nil * * Comparison---Returns -1 if other_str is greater than, 0 if * other_str is equal to, and +1 if other_str is less than @@ -1085,7 +1085,7 @@ rb_str_cmp_m(str1, str2) /* * call-seq: - * str.casecmp(other_str) => -1, 0, +1 + * str.casecmp(other_str) => -1, 0, +1 or nil * * Case-insensitive version of String#<=>. * diff --git a/time.c b/time.c index df43e2339a..6fe5326dda 100644 --- a/time.c +++ b/time.c @@ -950,12 +950,9 @@ time_usec(time) /* * call-seq: - * time <=> other_time => -1, 0, +1 - * time <=> numeric => -1, 0, +1 + * time <=> other_time => -1, 0, +1 or nil * - * Comparison---Compares time with other_time or with - * numeric, which is the number of seconds (possibly - * fractional) since epoch. + * Comparison---Compares time with other_time. * * t = Time.now #=> Wed Apr 09 08:56:03 CDT 2003 * t2 = t + 2592000 #=> Fri May 09 08:56:03 CDT 2003