On 7/26/05, "TSa (Thomas Sandlaß)" <[EMAIL PROTECTED]> wrote:
> Piers Cawley wrote:
> > I would like to be able to iterate over all the
> > objects in the live set.
>
> My Idea actually is to embedd that into the namespace syntax.
> The idea is that of looking up non-negativ integer literals
> with 0 beeing the namespace owner.
>
> for ::Namespace -> $instance
> {
> if +$instance != 0 { reconfigure $instance }
> }
Oh, so a namespace can behave as an array then. Well, to avoid
auto-flattening problems in other, more common places, we ought to
make that:
for *::Namespace -> $instance {...}
However, this is very huffmanly incorrect. First of all, what you're
doing may take a quarter of a second or more for a large program
(which isn't a short amount of time by any means). Second, the fact
that you're using it means you're doing something evil. Third, only a
fraction of 1/omega perl programmers will be using this feature.
Therefore, it should probably look like:
use introspection;
for introspection::ALL_INSTANCES(::Namespace) -> $instance {...}
And it might even be platform-specific, given the constraints of some
of our targets.
Luke