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

ruby-changes:27611

From: nagachika <ko1@a...>
Date: Sat, 9 Mar 2013 22:43:48 +0900 (JST)
Subject: [ruby-changes:27611] nagachika:r39663 (ruby_2_0_0): merge revision(s) 39414:

nagachika	2013-03-09 22:43:36 +0900 (Sat, 09 Mar 2013)

  New Revision: 39663

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

  Log:
    merge revision(s) 39414:
    
    * object.c (rb_obj_comp): Documenting Object#<=> return values
      Patch by Stefan Rusterholz

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/object.c
    branches/ruby_2_0_0/version.h

Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 39662)
+++ ruby_2_0_0/ChangeLog	(revision 39663)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Sat Mar  9 22:38:26 2013  Zachary Scott  <zachary@z...>
+
+	* object.c (rb_obj_comp): Documenting Object#<=> return values
+	  Patch by Stefan Rusterholz
+
 Sat Mar  9 22:35:22 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* dir.c (file_s_fnmatch, fnmatch_brace): encoding-incompatible pattern
Index: ruby_2_0_0/object.c
===================================================================
--- ruby_2_0_0/object.c	(revision 39662)
+++ ruby_2_0_0/object.c	(revision 39663)
@@ -1320,6 +1320,17 @@ rb_obj_not_match(VALUE obj1, VALUE obj2) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/object.c#L1320
  *     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)
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 39662)
+++ ruby_2_0_0/version.h	(revision 39663)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #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

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r39414


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

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