From: Nobuyoshi Nakada Date: 2013-10-31T13:26:54+09:00 Subject: [ruby-core:58093] Re: [ruby-trunk - Feature #9064] Add support for packages, like in Java (13/10/31 5:15), David MacMahon wrote: > On a semi-related note, I find it mildly frustrating that all openings of a class requires specifying the same superclass. Sometimes I just want to add a constant or simple method to a class, so it would be nice to be able to re-open that class without having to explicitly specify the same superclasses every time. It would be nice if the following were allowed: > > class Foo < Bar; end # class Foo extends Bar > class Foo; end # class Foo still extends Bar This is allowed already. > class Foo; end # class Foo has Object as a "stand-in" superclass > class Foo < Bar; end # class Foo replaces Bar as its "official" superclass If it is allowed, class C; end c = C.new class C < String; end c.size # will segfault with the current object system. -- Nobu Nakada