On Fri, 2004-03-26 at 15:20, Luke Palmer wrote:

> When writing Perl 5, I always find myself writing @{ more often than @$.
> Maybe it's just a bad habit that I don't tend to use a lot of
> intermediate variables.

Well, one of the big problems with Perl 5's dereferencing is that it's
painful to create intermediate variables that make it any easier. For
example, you can say "my $ref = $x{$y}{$z};@$ref" or you can say "local
*ary=$x{$y}{$z};@ary" but the latter isn't that obvious to most, and can
run afoul of strict. In Perl 6:

        my @ary := %x{$y}{$z};

should make it much more likely that we'll all use those intermediates.
I also seem to recall something about a ".@" operator that would work
like so:

        for %x{$y}{$z}.@ -> $i {...}

No? If everything else is chained on the right for dereferencing, I
certainly see the utility in this. Am I imagining that it was stated
earlier?

What's more that could be:

        for *%x{$y}{$z} -> $i {...}

and I can't imagine it makes any sense to bind that * anywhere but:

        for *(%x{$y}{$z}) -> $i {...}

I like the division between @ and *, since the two meanings had somewhat
too much overlap in most code.


-- 
Aaron Sherman <[EMAIL PROTECTED]>
Senior Systems Engineer and Toolsmith
"It's the sound of a satellite saying, 'get me down!'" -Shriekback


Reply via email to