summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--object.c11
-rw-r--r--version.h2
3 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0370ea99a8..849e42dfff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Mar 9 22:38:26 2013 Zachary Scott <zachary@zacharyscott.net>
+
+ * object.c (rb_obj_comp): Documenting Object#<=> return values
+ Patch by Stefan Rusterholz
+
Sat Mar 9 22:35:22 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dir.c (file_s_fnmatch, fnmatch_brace): encoding-incompatible pattern
diff --git a/object.c b/object.c
index ceee4d47eb..76ff316543 100644
--- a/object.c
+++ b/object.c
@@ -1320,6 +1320,17 @@ rb_obj_not_match(VALUE obj1, VALUE obj2)
* obj <=> other -> 0 or nil
*
* Returns 0 if obj === other, otherwise nil.
+ *
+ * The <=> is used by various methods to compare objects, for example
+ * Enumerable#sort, Enumerable#max etc.
+ *
+ * Your implementation of <=> should return one of the following values: -1, 0,
+ * 1 or nil. -1 means self is smaller than other. 0 means self is equal to other.
+ * 1 means self is bigger than other. Nil means the two values could not be
+ * compared.
+ *
+ * When you defined <=>, you can include Comparable to gain the methods <=, <,
+ * ==, >=, > and between?.
*/
static VALUE
rb_obj_cmp(VALUE obj1, VALUE obj2)
diff --git a/version.h b/version.h
index 911134b9c7..00f3eb7988 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#define RUBY_VERSION "2.0.0"
#define RUBY_RELEASE_DATE "2013-03-09"
-#define RUBY_PATCHLEVEL 32
+#define RUBY_PATCHLEVEL 33
#define RUBY_RELEASE_YEAR 2013
#define RUBY_RELEASE_MONTH 3