Luke Palmer wrote:
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 {...}
Well, even more huffmanized would be
for Namespace -> {...; use $_}
might be what you expect after
my @array = (0,1,2,3);
::Namespace ::= @array;
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 {...}
This is why I wonder how writeable the namespace is, and when.
On some platforms it might actually not even be readable because
it was compiled away or stripped from the excecutable ;)
All that remains then is the possible behaviour as it is constrained
by the types of souls/daemons the creator happened to *choose*.
I guess you should re-read $Luke::Bible or watch the
$*::Movies::WarnerBrothers::Matrix again :))
If both refs are undef in your namespace, go and bind them!
If the above is insulting, feel free to invoke my &.apologize with
you as topic. You know, I'm the $/ of this $email.
And it might even be platform-specific, given the constraints of some
of our targets.
The platform is yet another restriction on Space::Search::Solution.
Interestingly namespace lookup is big endian...
--
$Language::Perl6::TSa.greeting
(somehow we are all part of it or was that $_?)