[MacRuby-devel] [MacRuby] #61: ObjectSpace.each_object(Foo) doesn't yield subclasses

MacRuby ruby-noreply at macosforge.org
Mon Dec 8 12:19:28 PST 2008


#61: ObjectSpace.each_object(Foo) doesn't yield subclasses
-------------------------------+--------------------------------------------
 Reporter:  kreatix@…          |        Owner:  lsansonetti@…        
     Type:  defect             |       Status:  closed               
 Priority:  blocker            |    Milestone:  MacRuby 0.2          
Component:  MacRuby            |   Resolution:  fixed                
 Keywords:                     |  
-------------------------------+--------------------------------------------

Comment(by kreatix@…):

 This seems to be broken again.

 {{{
 >> ObjectSpace.each_object(Module).map { |x| x.class }.uniq
 => [Module]
 >> ObjectSpace.each_object(Class).map { |x| x.class }.uniq
 => [Class, Module]
 >> ObjectSpace.each_object(Class).include? NSObject
 => false
 >> NSObject.is_a? Class
 => true
 }}}

 on MRI 1.9:

 {{{
 >> ObjectSpace.each_object(Module).map { |x| x.class }.uniq
 => [Module, Class]
 >> ObjectSpace.each_object(Class).map { |x| x.class }.uniq
 => [Class]
 }}}

 PS. I tried to reopen the ticket, but got "Warning: No permission to
 change ticket fields."
 Perhaps I should create a new one?

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/61#comment:2>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list