NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
man or boy (Score:1)
I have not found Moritz's code for the man or boy test. My try with the last revision goes to 9. It reaches max recursion depth for 10. Here it is:
sub A($k is copy, $x1, $x2, $x3, $x4, $x5) {my $B = sub { A(--$k, $B, $x1, $x2, $x3, $x4) };
$k <= 0 ?? $x4() + $x5() !! $B();
}
say A(9, sub{1}, sub{-1}, sub{-1}, sub{1}, sub{0} );
What is the need for & sigil you mention? I have done by hand some crude tailcall optimization in the generated PIR and it reaches the recursion depth limit on 13
Re:man or boy (Score:1)
I have not found Moritz's code for the man or boy test.
Moritz's test is here: http://svn.pugscode.org/pugs/t/spec/integration/man-or-boy.t [pugscode.org]
Reply to This
Parent