99problems-31-to-40 failure

2009-10-01 Thread Kevin Phair

# P35 (**) Determine the prime factors of a given positive integer.

This test fails for me with the latest Rakudo.  It looks like this is 
because when a variable is pushed onto an array, and then 
auto-incremented, it is also auto-incremented inside the array.


my @stuff;
my $w = 1;
@stuff.push($w);
@stuff.say;
$w++;
@stuff.say;

gives an output of:
1
2

I'm still catching up, so I'm not sure if that behavior is expected and 
the test is wrong or vice versa (or if I'm just completely missing 
something).


Re: 99problems-31-to-40 failure

2009-10-01 Thread Daniel Ruoso
Em Qui, 2009-10-01 às 12:22 -0400, Kevin Phair escreveu:
 This test fails for me with the latest Rakudo.  It looks like this is 
 because when a variable is pushed onto an array, and then 
 auto-incremented, it is also auto-incremented inside the array.
 my @stuff;
 my $w = 1;
 @stuff.push($w);
 @stuff.say;
 $w++;
 @stuff.say;
 gives an output of:
 1
 2

This is a rakudo bug, what's probably happening here is that rakudo is
just adding the push *...@args to the end of @stuff, while it was supposed
to get an iterator for it and consume it while copying the values into
@stuff, which is basically the difference between assign and bind.

daniel