On Thu, 30 Oct 2008, ???? wrote:

Hi there,
question about arrays and array refs in Rakudo today.

I have array ref
my $ar = [1,2,3];
how can I go over it?

I try:
my $r = [1,2,3]; say $r.elems;
3
my $r = [1,2,3]; say $r.WHAT;
Array
my $r = [1,2,3]; "Y".say for $r;
Y
my $r = [1,2,3]; .say for $r;
1 2 3 #one string
my $r = <1 2 3>; for $r.list { "Y".say };
Y
my $r = [1,2,3]; my @a := $r; "Y".say for @a;
Y

my $r = <1 2 3>; for $r -> $t { say $t };

There are other ways too, but unfortunately some don't work at the moment :).


---------------------------------------------------------------------
| Name: Tim Nelson                 | Because the Creator is,        |
| E-mail: [EMAIL PROTECTED]    | I am                           |
---------------------------------------------------------------------

----BEGIN GEEK CODE BLOCK----
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
-----END GEEK CODE BLOCK-----

Reply via email to