Re: [perl #129884] Strange behaviour on "say".
Rakudo*'s latest version (2016.07.01) has perl6::build-date=2016-07-22T12:37:00Z which indeed predates that commit Fri Aug 5 15:57:18 2016 -0700 .
Re: [perl #129884] Strange behaviour on "say".
On Sat, Oct 15, 2016 at 09:59:01PM +0200, Timo Paulssen wrote: : Actually, I just tested the code and on my machine it always outputs : "test". The only difference between uncommenting "say 'run'" is that : it'll output "run" once at the end - or not. : : So now I'm wondering what i did differently from you?! More precisely, this was fixed in: commit 589061eac14f2847e2c4b401d2ff2eb30c62675e Author: TimToady Date: Fri Aug 5 15:57:18 2016 -0700 loop and repeat not properly self-sinking Loops at statementlist level should be self-sinking by default. The loop and repeat forms of loop were not doing this correctly. Fixes RT #127563 and RT #128596. Larry
Re: [perl #129884] Strange behaviour on "say".
On Sat, Oct 15, 2016 at 09:59:01PM +0200, Timo Paulssen wrote: : Actually, I just tested the code and on my machine it always outputs : "test". The only difference between uncommenting "say 'run'" is that : it'll output "run" once at the end - or not. : : So now I'm wondering what i did differently from you?! Used a newer version, I'll warrant. Larry
Re: [perl #129884] Strange behaviour on "say".
Actually, I just tested the code and on my machine it always outputs "test". The only difference between uncommenting "say 'run'" is that it'll output "run" once at the end - or not. So now I'm wondering what i did differently from you?!
Re: [perl #129884] Strange behaviour on "say".
On 10/15/2016 01:26 PM, janko popov (via RT) wrote: > # New Ticket Created by janko popov > # Please include the string: [perl #129884] > # in the subject line of all future correspondence about this issue. > # https://rt.perl.org/Ticket/Display.html?id=129884 > > > > Hi, > > Maybe this is known bug, maybe not :-) But I cannot finding it on > https://rt.perl.org. > I found very strange behaviour on "say". > If we run code below then the "test" not appeared, but if we uncomment row > #say 'run'; > the "test" appeared. > > # This is Rakudo version 2016.07.1 built on MoarVM version 2016.07 > # implementing Perl 6.c. > # Linux 4.2.0-42-generic #49~14.04.1-Ubuntu SMP Wed Jun 29 20:22:11 UTC > 2016 x86_64 x86_64 x86_64 GNU/Linux > > sub test { > loop (my $i = 0; $i < 10; ++$i) { > loop (my $j = 0; $j < 10; ++$j) { > say 'test'; > } > } > #say 'run'; > } > > test; This is about lazy lists and sinking. When you make the loop the not-last line, it'll be the return value of the sub. Tbh, i would have expected the call to test in sink context (i.e. not assigning anything) to cause the full execution of that loop.
Re: [perl #129884] Strange behaviour on "say".
A clue, for what it's worth. Any valid instruction, (or even a variable declaration) after the "}" ending the innermost loop appears to enable the output. Inside the loop, it doesn't.. On 10/15/16, janko popov wrote: > # New Ticket Created by janko popov > # Please include the string: [perl #129884] > # in the subject line of all future correspondence about this issue. > # https://rt.perl.org/Ticket/Display.html?id=129884 > > > > Hi, > > Maybe this is known bug, maybe not :-) But I cannot finding it on > https://rt.perl.org. > I found very strange behaviour on "say". > If we run code below then the "test" not appeared, but if we uncomment row > #say 'run'; > the "test" appeared. > > # This is Rakudo version 2016.07.1 built on MoarVM version 2016.07 > # implementing Perl 6.c. > # Linux 4.2.0-42-generic #49~14.04.1-Ubuntu SMP Wed Jun 29 20:22:11 UTC > 2016 x86_64 x86_64 x86_64 GNU/Linux > > sub test { > loop (my $i = 0; $i < 10; ++$i) { > loop (my $j = 0; $j < 10; ++$j) { > say 'test'; > } > } > #say 'run'; > } > > test; >