Re: Is < > creating and Array or Parcel ?

2015-08-03 Thread Timo Paulssen
On 08/02/2015 02:35 PM, Lloyd Fournier wrote: > @a = $z[0].list > > or in a less documented way: > > @a = $z[0]<> > > The idea is that you can store an array in ether a @ or $ variable. > Where as in perl5 you could only store a reference in $ variable. The > sigil simply tells perl6 how it shoul

Re: Is < > creating and Array or Parcel ?

2015-08-03 Thread Marc Chantreux
On Sun, Aug 02, 2015 at 10:35:23PM +1000, Lloyd Fournier wrote: > If you want to assign to an array which is an element of another array: > > @a = $z[0].list this is very confusing because this is not a LoL. $z.flat seems more intuitive to me. -- Marc Chantreux (eiro on github and freenode) htt

Re: Is < > creating and Array or Parcel ?

2015-08-03 Thread Richard Hainsworth
Having followed Perl6 from its inception, it is good to see Christmas will be coming this year :) Richard On 08/03/2015 08:49 AM, Larry Wall wrote: On Sun, Aug 02, 2015 at 03:09:07PM +0200, Moritz Lenz wrote: : If you want to extract it from the scalar, use the @ again, this : time as a prefi

Re: Is < > creating and Array or Parcel ?

2015-08-03 Thread Lloyd Fournier
Non expert opinion here. my $z = ['a', 'b', 'c']; Is a real array. The difference is that is in a non-auto flattening container (variable). If you want to iterate over it you can: for @$z { ... } # like perl5 If you want to assign it to @ array then do the same thing @a = @$z. If you want to a

Re: Is < > creating and Array or Parcel ?

2015-08-03 Thread Gabor Szabo
On Mon, Aug 3, 2015 at 3:49 AM, Larry Wall wrote: > On Sun, Aug 02, 2015 at 03:09:07PM +0200, Moritz Lenz wrote: > : If you want to extract it from the scalar, use the @ again, this > : time as a prefix: > : > : for @$s { } # two iterations again. > > Note that this distinction will go away after

Re: Is < > creating and Array or Parcel ?

2015-08-02 Thread Larry Wall
On Sun, Aug 02, 2015 at 03:09:07PM +0200, Moritz Lenz wrote: : If you want to extract it from the scalar, use the @ again, this : time as a prefix: : : for @$s { } # two iterations again. Note that this distinction will go away after the Great List Refactor, so Gabor gets his wish. Part of the G

Re: Is < > creating and Array or Parcel ?

2015-08-02 Thread Marc Chantreux
> It's an Array inside a Scalar. This is really disturbing from a newcommer perspective. I don't know much about the Perl6 internals so maybe i can explain it better (or someone can fix me): Let's try: Everything is an object in Perl6, which comes with roles and inheritances and [Sigils](http:/

Re: Is < > creating and Array or Parcel ?

2015-08-02 Thread Gabor Szabo
This whole thing sounds quite complex. What is the value behind this complexity? Gabor

Re: Is < > creating and Array or Parcel ?

2015-08-02 Thread Moritz Lenz
Hi, On 02.08.2015 06:43, Gabor Szabo wrote: On Fri, Jul 31, 2015 at 4:16 PM, Moritz Lenz mailto:mor...@faui2k3.org>> wrote: On 07/31/2015 03:02 PM, Gabor Szabo wrote: The following code (with comments) is confusing me. Can someone give some explanation please? S

Re: Is < > creating and Array or Parcel ?

2015-08-01 Thread Gabor Szabo
On Fri, Jul 31, 2015 at 4:16 PM, Moritz Lenz wrote: > > > On 07/31/2015 03:02 PM, Gabor Szabo wrote: > >> The following code (with comments) is confusing me. >> Can someone give some explanation please? >> Specifically the difference between >> >> my @x = ; >> > > It's the assignment to the Array

Re: Is < > creating and Array or Parcel ?

2015-07-31 Thread Moritz Lenz
On 07/31/2015 03:02 PM, Gabor Szabo wrote: The following code (with comments) is confusing me. Can someone give some explanation please? Specifically the difference between my @x = ; It's the assignment to the Array variable that makes the Array here; < > by itself just creates a Parcel:

Is < > creating and Array or Parcel ?

2015-07-31 Thread Gabor Szabo
The following code (with comments) is confusing me. Can someone give some explanation please? Specifically the difference between my @x = ; my $z = @x; and my $z = ; Gabor use v6; # < > creates an array here: my @x = ; say @x.WHICH; # Array|140713422866208 say @x;# a b say @x[0];