mortee wrote: > Charles Oliver Nutter wrote: >> Daniel Berger wrote: >>> irb: You've got jirb. >>> lib\irb\completion.rb:152: ObjectSpace.each_object(Module){|m| >> This could still be supported through a similar mechanism as >> each_object(Class), by keeping a weak hash of all Module instances. >> >>> shell: This could be a problem. >>> lib\shell\process-controller.rb:216: ObjectSpace.each_object(IO) do >> I'd be surprised if shell worked 100% correctly right now anyway, due to >> process-control requirements we can't support well on JVM. But I would >> also expect this use of each_object to have a "better" implementation, >> and if not it could again be a specific-purpose weak hash for IO streams >> (which we almost have already since we want to be able to clean them up >> on exit. > > Speaking of multiple cases of possible class-specific instance > tracking... isn't it possible to register your interest in some such > class at some point explicitely from program code - and then any class > could be made enumerable. Yes, that is possible...but it solves only part of the problem. Just having ObjectSpace.each_object enableable through a flag allows it to be fully functional when you want it and out of the way the rest of the time. - Charlie