Piers Cawley <[EMAIL PROTECTED]> wrote:
> It seems to me, that the way to get at all the instances of a class is to ask
> the Garbage Collector to do the heavy lifting for us, and ideally I'd like to
> see this exposed at the Perl level.

It's entirely possible that Perl will be used on virtual machines
where this can't be done.

I'd suggest that we simply declare that every metaclass must support a
".all" method which returns an arrayish thing containing all active
objects it is managing:

   grep { .isa($class) } MetaClass.all;

Whether this works by interfacing with the garbage collector, keeping
an array of weak references, or waving a wooden wand and yelling
"Accio objects" is completely up to the metaclass in question.

(Sorry, been reading too much Potter lately...)

-- 
Brent 'Dax' Royal-Gordon <[EMAIL PROTECTED]>
Perl and Parrot hacker

Reply via email to