On Sat Aug 11 06:30:56 2012, [email protected] wrote: > On Wed Aug 08 07:32:03 2012, masak wrote: > > <masak> std: repeat { say "OH HAI" } > > <p6eval> std f43a358: OUTPUT«===SORRY!===Undeclared routine: > > 'repeat' used at line 1Check failedFAILED 00:00 41m» > > <masak> hm. > > <jnthn> did you mean loop? > > <masak> jnthn: no, I meant to check what happens if I do 'repeat' > > without the 'until' or 'while' after the block. > > <masak> std: repeat { say "OH HAI" } while True > > <p6eval> std f43a358: OUTPUT«ok 00:00 41m» > > <masak> I'm surprised it parses as a listop when the 'while' is not there. > > <jnthn> Hmmmm. > > <jnthn> Surely it doesn't backtrack there... > > <masak> right. > > <jnthn> std: repeat { my $x; say "OH HAI" } > > <p6eval> std f43a358: OUTPUT«===SORRY!===Undeclared routine: > > 'repeat' used at line 1 [...] Check failedFAILED 00:00 42m» > > <jnthn> r: repeat { say "OH HAI" } # curious > > <p6eval> rakudo 34e8d4: OUTPUT«===SORRY!===CHECK FAILED:Undefined > > routine '&repeat' called (line 1)» > > <PerlJam> That could make for some interesting code. > > <PerlJam> r: sub repeat { $^a.() }; repeat { say "hi" } > > <p6eval> rakudo 34e8d4: OUTPUT«hi» > > <jnthn> Wow! > > <PerlJam> r: sub repeat { $^a.() }; repeat { say "hi" }; my $i = 0; > > repeat { say "foo" } while $i++ < 3; > > <p6eval> rakudo 34e8d4: OUTPUT«hifoofoofoofoo» > > <PerlJam> good for obfuscation I guess > > <masak> was gonna say. > > <masak> I feel 'repeat' is a badly chosen name for that sub :P > > <jnthn> I think the parser is gonna need to commit after seeing > repeat, fwiw > > * masak submits stdbug > > * masak submits rakudobug > > * jnthn will wait for an STD fix and steal that > > Taken the STD fix, so now: > > > repeat { say "OH HAI" } > "repeat" is missing its "while" or "until" > > Tagging testneeded. > > /jnthn
Test added to S04-statements/repeat.t -- Will "Coke" Coleda
