> -----Original Message-----
> From: [EMAIL PROTECTED]
>
> [EMAIL PROTECTED] (Austin Hastings) writes:
> > Before this gets simonized, let me add that this seems
> genuinely useful: It provides a way of constructing a loop in a
> dimension that is not really accessible, except via recursion.
>
> Oh, it *is* useful, and it's extremely nice to know that
> something like this will be able to be done as a user-defined
> extension, outside the core, or even in the standard library,
> I don't mind, once the Perl 6 core itself gets designed and
> implemented.
Granted it can be a UDF. My interest is more in the question "What else have
we omitted?"
As I recall, the discussion a while back about iterators quickly mutated
into a discussion on how to do coroutines. We never actually explored the
"what cool things are possible with iterators as a basic data object/type"
question.
Luke just illuminated one of those dark corners for us:
"By applying iteration to iterators, you can express
complex code structures via arrays.
"Also, you can reclaim the FORTRAN variable namespace
($i..$n) for other uses."
Cool:- thinking on it, the fact that every damn coding book on the planet
has a section about nesting loops should have been a flag that P6l should be
looking at that.
What else have we missed?
=Austin
PS: The thought just occurred to me that C<outer> enables something like:
for outer(*grep ...) -> @indices {...}
which means that the code structure gets even more dynamic.
I wonder if it's possible to code C<outer> to handle variable length, like
walking a graph. (Garbage collector, anyone?) That would be C<traverse>, or
<enumerate>. Good for walking XML, too.