Forum: Ruby-core [ruby-trunk - Bug #7449][Open] Rdoc for obj.object_id

Posted by Heesob Park (phasis)
on 2012-11-28 05:45
(Received via mailing list)
Issue #7449 has been reported by phasis68 (Heesob Park).

----------------------------------------
Bug #7449: Rdoc for obj.object_id
https://bugs.ruby-lang.org/issues/7449

Author: phasis68 (Heesob Park)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 2.0.0dev (2012-11-27 trunk 37869) [x64-mswin64_100]


Documentation for return type of obj.object_id is wrong on Windows x64.

C:\Users\phasis>irb
irb(main):001:0> 0.1.object_id
=> -158526706883441454
irb(main):002:0> 0.1.object_id.class
=> Bignum

Here is a patch:
diff --git a/gc.c b/gc.c.new
index d52208d..2a0f26a 100644
--- a/gc.c
+++ b/gc.c.new
@@ -1670,8 +1670,8 @@ id2ref(VALUE obj, VALUE objid)
  *  Document-method: object_id
  *
  *  call-seq:
- *     obj.__id__       -> fixnum
- *     obj.object_id    -> fixnum
+ *     obj.__id__       -> integer
+ *     obj.object_id    -> integer
  *
  *  Returns an integer identifier for <i>obj</i>. The same number will
  *  be returned on all calls to <code>id</code> for a given object, and
Posted by Luis Lavena (luislavena)
on 2012-11-28 05:47
(Received via mailing list)
Issue #7449 has been updated by luislavena (Luis Lavena).

Category set to DOC
Status changed from Open to Assigned
Assignee set to drbrain (Eric Hodel)
Target version set to 2.0.0


----------------------------------------
Bug #7449: Rdoc for obj.object_id
https://bugs.ruby-lang.org/issues/7449#change-34067

Author: phasis68 (Heesob Park)
Status: Assigned
Priority: Normal
Assignee: drbrain (Eric Hodel)
Category: DOC
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-11-27 trunk 37869) [x64-mswin64_100]


Documentation for return type of obj.object_id is wrong on Windows x64.

C:\Users\phasis>irb
irb(main):001:0> 0.1.object_id
=> -158526706883441454
irb(main):002:0> 0.1.object_id.class
=> Bignum

Here is a patch:
diff --git a/gc.c b/gc.c.new
index d52208d..2a0f26a 100644
--- a/gc.c
+++ b/gc.c.new
@@ -1670,8 +1670,8 @@ id2ref(VALUE obj, VALUE objid)
  *  Document-method: object_id
  *
  *  call-seq:
- *     obj.__id__       -> fixnum
- *     obj.object_id    -> fixnum
+ *     obj.__id__       -> integer
+ *     obj.object_id    -> integer
  *
  *  Returns an integer identifier for <i>obj</i>. The same number will
  *  be returned on all calls to <code>id</code> for a given object, and
Posted by zzak (Zachary Scott) (Guest)
on 2012-11-28 05:54
(Received via mailing list)
Issue #7449 has been updated by zzak (Zachary Scott).


Luis, can you confirm this on windows?
----------------------------------------
Bug #7449: Rdoc for obj.object_id
https://bugs.ruby-lang.org/issues/7449#change-34068

Author: phasis68 (Heesob Park)
Status: Assigned
Priority: Normal
Assignee: drbrain (Eric Hodel)
Category: DOC
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-11-27 trunk 37869) [x64-mswin64_100]


Documentation for return type of obj.object_id is wrong on Windows x64.

C:\Users\phasis>irb
irb(main):001:0> 0.1.object_id
=> -158526706883441454
irb(main):002:0> 0.1.object_id.class
=> Bignum

Here is a patch:
diff --git a/gc.c b/gc.c.new
index d52208d..2a0f26a 100644
--- a/gc.c
+++ b/gc.c.new
@@ -1670,8 +1670,8 @@ id2ref(VALUE obj, VALUE objid)
  *  Document-method: object_id
  *
  *  call-seq:
- *     obj.__id__       -> fixnum
- *     obj.object_id    -> fixnum
+ *     obj.__id__       -> integer
+ *     obj.object_id    -> integer
  *
  *  Returns an integer identifier for <i>obj</i>. The same number will
  *  be returned on all calls to <code>id</code> for a given object, and
Posted by Luis Lavena (luislavena)
on 2012-11-28 06:05
(Received via mailing list)
Issue #7449 has been updated by luislavena (Luis Lavena).


zzak (Zachary Scott) wrote:
> Luis, can you confirm this on windows?

I don't think the Windows part is relevant but the documentation 
mistake.

You can confirm this here:

http://rubydoc.info/stdlib/core/Object:object_id

It says "Returns an integer identifier for obj" but then it says fixnum.

I've assigned to Eric Hodel to confirm is a bug in the documentation (or 
not) and act accordingly.

Thank you.
----------------------------------------
Bug #7449: Rdoc for obj.object_id
https://bugs.ruby-lang.org/issues/7449#change-34069

Author: phasis68 (Heesob Park)
Status: Assigned
Priority: Normal
Assignee: drbrain (Eric Hodel)
Category: DOC
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-11-27 trunk 37869) [x64-mswin64_100]


Documentation for return type of obj.object_id is wrong on Windows x64.

C:\Users\phasis>irb
irb(main):001:0> 0.1.object_id
=> -158526706883441454
irb(main):002:0> 0.1.object_id.class
=> Bignum

Here is a patch:
diff --git a/gc.c b/gc.c.new
index d52208d..2a0f26a 100644
--- a/gc.c
+++ b/gc.c.new
@@ -1670,8 +1670,8 @@ id2ref(VALUE obj, VALUE objid)
  *  Document-method: object_id
  *
  *  call-seq:
- *     obj.__id__       -> fixnum
- *     obj.object_id    -> fixnum
+ *     obj.__id__       -> integer
+ *     obj.object_id    -> integer
  *
  *  Returns an integer identifier for <i>obj</i>. The same number will
  *  be returned on all calls to <code>id</code> for a given object, and
Posted by drbrain (Eric Hodel) (Guest)
on 2012-11-28 06:20
(Received via mailing list)
Issue #7449 has been updated by drbrain (Eric Hodel).


changing to Integer is fine with me. It seems to be a better type.
----------------------------------------
Bug #7449: Rdoc for obj.object_id
https://bugs.ruby-lang.org/issues/7449#change-34070

Author: phasis68 (Heesob Park)
Status: Assigned
Priority: Normal
Assignee: drbrain (Eric Hodel)
Category: DOC
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-11-27 trunk 37869) [x64-mswin64_100]


Documentation for return type of obj.object_id is wrong on Windows x64.

C:\Users\phasis>irb
irb(main):001:0> 0.1.object_id
=> -158526706883441454
irb(main):002:0> 0.1.object_id.class
=> Bignum

Here is a patch:
diff --git a/gc.c b/gc.c.new
index d52208d..2a0f26a 100644
--- a/gc.c
+++ b/gc.c.new
@@ -1670,8 +1670,8 @@ id2ref(VALUE obj, VALUE objid)
  *  Document-method: object_id
  *
  *  call-seq:
- *     obj.__id__       -> fixnum
- *     obj.object_id    -> fixnum
+ *     obj.__id__       -> integer
+ *     obj.object_id    -> integer
  *
  *  Returns an integer identifier for <i>obj</i>. The same number will
  *  be returned on all calls to <code>id</code> for a given object, and
Posted by zzak (Zachary Scott) (Guest)
on 2012-11-28 21:25
(Received via mailing list)
Issue #7449 has been updated by zzak (Zachary Scott).


eric, you mean Fixnum right?

Or change rb_obj_id implementation to return INT2NUM((SIGNED_VALUE)obj);
----------------------------------------
Bug #7449: Rdoc for obj.object_id
https://bugs.ruby-lang.org/issues/7449#change-34096

Author: phasis68 (Heesob Park)
Status: Assigned
Priority: Normal
Assignee: drbrain (Eric Hodel)
Category: DOC
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-11-27 trunk 37869) [x64-mswin64_100]


Documentation for return type of obj.object_id is wrong on Windows x64.

C:\Users\phasis>irb
irb(main):001:0> 0.1.object_id
=> -158526706883441454
irb(main):002:0> 0.1.object_id.class
=> Bignum

Here is a patch:
diff --git a/gc.c b/gc.c.new
index d52208d..2a0f26a 100644
--- a/gc.c
+++ b/gc.c.new
@@ -1670,8 +1670,8 @@ id2ref(VALUE obj, VALUE objid)
  *  Document-method: object_id
  *
  *  call-seq:
- *     obj.__id__       -> fixnum
- *     obj.object_id    -> fixnum
+ *     obj.__id__       -> integer
+ *     obj.object_id    -> integer
  *
  *  Returns an integer identifier for <i>obj</i>. The same number will
  *  be returned on all calls to <code>id</code> for a given object, and
Posted by drbrain (Eric Hodel) (Guest)
on 2012-11-29 02:22
(Received via mailing list)
Issue #7449 has been updated by drbrain (Eric Hodel).


"return a fixnum" is not a specification of #object_id so the more 
generic "integer" is better.
----------------------------------------
Bug #7449: Rdoc for obj.object_id
https://bugs.ruby-lang.org/issues/7449#change-34109

Author: phasis68 (Heesob Park)
Status: Assigned
Priority: Normal
Assignee: drbrain (Eric Hodel)
Category: DOC
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-11-27 trunk 37869) [x64-mswin64_100]


Documentation for return type of obj.object_id is wrong on Windows x64.

C:\Users\phasis>irb
irb(main):001:0> 0.1.object_id
=> -158526706883441454
irb(main):002:0> 0.1.object_id.class
=> Bignum

Here is a patch:
diff --git a/gc.c b/gc.c.new
index d52208d..2a0f26a 100644
--- a/gc.c
+++ b/gc.c.new
@@ -1670,8 +1670,8 @@ id2ref(VALUE obj, VALUE objid)
  *  Document-method: object_id
  *
  *  call-seq:
- *     obj.__id__       -> fixnum
- *     obj.object_id    -> fixnum
+ *     obj.__id__       -> integer
+ *     obj.object_id    -> integer
  *
  *  Returns an integer identifier for <i>obj</i>. The same number will
  *  be returned on all calls to <code>id</code> for a given object, and
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.