From: Yusuke Endoh Date: 2010-05-03T17:11:50+09:00 Subject: [ruby-core:29955] [Bug #3222] Can bignums have singleton class & methods? Issue #3222 has been updated by Yusuke Endoh. Assigned to set to Yukihiro Matsumoto Target version changed from 1.9.2 to 1.9.x Hi, I think this is not a bug. It is still possible to define method to Bignum by redefining singleton_method_added first: x = (1 << 64) def x.singleton_method_added(x) end def x.foo p 1 end x.foo #=> 1 Matz actually fixed #601, but he was not keen to fix this kind of issue. [ruby-dev:36778] In fact, the above loophole is indicated by matz himself. I agree that Ruby should disallow access to the singleton class completely, but I don't know if it is easy or not. Anyway, we should discuss this matter towards 1.9.3 or later. I move this ticket to Feature tracker. -- Yusuke Endoh ---------------------------------------- http://redmine.ruby-lang.org/issues/show/3222 ---------------------------------------- http://redmine.ruby-lang.org