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

ruby-changes:29815

From: eregon <ko1@a...>
Date: Tue, 9 Jul 2013 22:26:08 +0900 (JST)
Subject: [ruby-changes:29815] eregon:r41867 (trunk): * object.c (rb_obj_cmp): Improve doc for Kernel#<=>

eregon	2013-07-09 22:25:57 +0900 (Tue, 09 Jul 2013)

  New Revision: 41867

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

  Log:
    * object.c (rb_obj_cmp): Improve doc for Kernel#<=>
      to clarify #equal? is not called. [See GH-352]

  Modified files:
    trunk/object.c

Index: object.c
===================================================================
--- object.c	(revision 41866)
+++ object.c	(revision 41867)
@@ -1375,7 +1375,8 @@ rb_obj_not_match(VALUE obj1, VALUE obj2) https://github.com/ruby/ruby/blob/trunk/object.c#L1375
  *  call-seq:
  *     obj <=> other -> 0 or nil
  *
- *  Returns 0 if obj.equal?(other) or obj == other, otherwise nil.
+ *  Returns 0 if +obj+ and +other+ are the same object
+ *  or <code>obj == other</code>, otherwise nil.
  *
  *  The <=> is used by various methods to compare objects, for example
  *  Enumerable#sort, Enumerable#max etc.
@@ -1385,7 +1386,7 @@ rb_obj_not_match(VALUE obj1, VALUE obj2) https://github.com/ruby/ruby/blob/trunk/object.c#L1386
  *  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 <=, <,
+ *  When you define <=>, you can include Comparable to gain the methods <=, <,
  *  ==, >=, > and between?.
  */
 static VALUE

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

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