* Ovid <[EMAIL PROTECTED]> [2006-05-24 18:00]:
> First off, thanks to Aristotle for clearing some of my
> thinking.

NP, it’s a good way for me to pick up the disparate Perl 6 clues
I picked up haphazardly over time, too.

> In my version of Pugs (6.2.11 (r10390)), that fails for two
> reasons, both of which I suspect are bugs.

These definitely sound like bugs – both of them.

>    for %buckets<w><array>.kv -> $i, $w {
> 
> Is .kv supposed to work there?  You're accessing an array, not
> a hash.

Yes, `.kv` is supposed to work on arrays, where it returns a list
of `$index => $value` pairs. This is very high on the list of
Perl 6 features I am anticipating eagerly, as it means you can
use natural `for(LIST)` constructs even when you need indices
while iterating, instead of having to use the familiar ugly
construction from Perl 5:

    for my $i ( 0 .. $#array ) {
        # use both $i and $array[ $i ] here
    }

In Perl 6, indexing into [EMAIL PROTECTED] explicitly will *not* be
necessary here. Hooray!

Regards,
-- 
#Aristotle
*AUTOLOAD=*_;sub _{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1};
&Just->another->Perl->hacker;

Reply via email to