Re: questions about array references and captures

2010-07-31 Thread R. Dresens
On Fri, 30 Jul 2010 19:06:09 +0200 Leon Timmermans wrote: > On Fri, Jul 30, 2010 at 6:21 PM, > R. Dresens wrote: > > 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 = \

Re: questions about array references and captures

2010-07-30 Thread Leon Timmermans
On Fri, Jul 30, 2010 at 6:21 PM, R. Dresens wrote: > 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

Re: questions about array references and captures

2010-07-30 Thread R. Dresens
On Fri, 30 Jul 2010 14:31:31 +0200 Leon Timmermans wrote: > On Thu, Jul 29, 2010 at 8:30 PM, R. Dresens wrote: > > > And what about this?... > >    my $x = [3, 4]; my @y = 1, 2, |$x, 5, 6; say @y.perl; > I think that you meant to do is this: > > my $x = [3, 4]; my @y = 1, 2, @($x), 5, 6;

Re: questions about array references and captures

2010-07-30 Thread R. Dresens
On Thu, 29 Jul 2010 20:55:39 -0700 Darren Duncan 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

Re: questions about array references and captures

2010-07-30 Thread Leon Timmermans
On Thu, Jul 29, 2010 at 8:30 PM, R. Dresens wrote: > And what about this?... > >    my $x = [3, 4]; my @y = 1, 2, |$x, 5, 6; say @y.perl; > > ...I actually expected `[1, 2, 3, 4, 5, 6]`, since I was under the > impression that the '|' was some kind of "flatten" or > "interpolation" operator. > >

Re: questions about array references and captures

2010-07-29 Thread Darren Duncan
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. Use an Array when you want to have a simple ordered