Hi folks!

I did some tests with the new for loop and don't understand some of the results. 
Perhaps this is just due to some warts in the implementation at the moment.
When looping over two lists of different length, the shorter stream shall give undefs, 
when it has come to the end of the list, AFAIK.

So this code:

@s1 = (11, 12, 13, 14);
@s2 = (21, 22, 23);

for @s1, @s2 -> $a {
  print $a, "\n";
}

gives:

11
12
13
14
21
22
23

as expected. But

@s1 = (11, 12, 13, 14);
@s2 = (21, 22, 23);

for @s1; @s2 -> $a {
  print $a, "\n";
}

gives:

11
21
12
22
13
23

It should give:

11
21
12
22
13
23
14
and something like 'Use of uninitialized ...' if warnigs were implemented.

Am I wrong?

Reply via email to