On Sun Jul 24 01:22:23 2016, barto...@gmx.de wrote:
> There are failing (skipped) tests for rakudo-j in S32-list/unique.t
> and S32-list/repeated.t that fail with 'This Seq has already been
> iterated, and its values consumed'. An example:
> 
> $ ./perl6-j -e 'my $a = <b b>; $a .= unique; say $a.perl'
> Seq.new-consumed()
> 
> As far as I understand, the problem happens because calling the
> mutator method with '$a .= unique' is executed in sink context. If I
> wrap that code in nqp::stmts to avoid sinking it works as expected:
> 
> $ ./perl6-j -e 'use nqp; my $a = <b b>; nqp::stmts($a .= unique); say
> $a.perl'
> ("b",).Seq
> 
> I took a look at the implementation of 'p6sink' for JVM and MoarVM and
> both implementations are calling method sink -- but maybe rakudo-m
> does not call it directly on the Seq?

Now, this is interesting. The first evaluations works now. Probably it got 
fixed by one of TimToady++'s recent sink related commits.

$ ./perl6-j -e 'my $a = <b b>; $a .= unique; say $a.perl'
("b",).Seq

But there is another version of that code, that still produces a consumed Seq:

$ ./perl6-j -e 'my $a = <b b>; $a.=unique; say $a.perl'
Seq.new-consumed()

Looks like '$a.=unique' is parsed differently than '$a .= unique'. (Something 
with 'dotty' instead of 'infix: .='.)

Reply via email to