On Thu, 29 Jul 2010 20:55:39 -0700
Darren Duncan <dar...@darrenduncan.net> wrote:

> R. Dresens wrote:

> > I have some issues with the behavior related to array references
> > and their actual replacements known as "captures" (as far as I'm
> > correct).
 
> Captures are not replacements for Arrays in general; they serve
> different purposes.

Yes, but aren't captures somehow replacements for references in
general... and therefore also array references? The reason why I
assume that is that I (wrongly?) expected a "real" 'Array()' when I
used the `\` prefix in an expression such as `...@x`.  `...@x` is an
array, but ` \...@x` has become a 'Capture()' in recent rakudo
releases, not an 'Array()' anymore. Hence my assumption.

...but an "anoymous array" (if I may call it that?) assigned to `$x`
is still an 'Array()'. So I'm really confused about the
intricate difference between...

    my $x = [1, 2, 3]

...and...

    my @y = (1, 2, 3); my $x = \...@y

...apart from the question whether it has really an impact on
practical code. I'm more or less trying to create a model of perl 6
in my mind right now, and I really wonder how to explain this
behavior.

> You could say a Capture is a replacement for the @_ of Perl 5
> though.

> At least that's my understanding of it.

Indeed,

But there seems to be more than meets the eye here, and I'm
a little confused about that.

The official specs probably contain the answer, but I haven't
found it yet. Let's see what this weekend brings ;)

Greetings,

Raymond.

Reply via email to