On Mon, 21 May 2001, Yukihiro Matsumoto wrote: > |shouldn't there be a version of Module#included_modules or #ancestors > |which actually returns the uncrippled list of included modules at the > |immediate level? Current versions of those two methods only lists them > |recursively and don't count repeated inclusion. I want the stuff that's > |really written in the Module, not some predigested version. > > There's no such thing like repeated inheritance (or inclusion) in > Ruby. Currently second attempt of inclusion is just ignored. Please see the program listing in [ruby-talk:12558], and: 1. Explain why that program works. 2. Explain why you think that feature is a really bug. 3. Explain why that feature should be removed. > |also I'd like a method to find whether an object has a singleton class, > |without creating one. This is not possible because Object itself doesn't > |have an #extended_modules, though it has a #singleton_methods. > class <<obj > p self.instance_methods > end Not only this piece of code does not find out whether there was already a singleton class associated to that object... but, according to page 243 of the Pickaxe book, this actually creates a singleton class for the object. Which leaves this question doubly unanswered. matju