A sample NQP program
sub factorial($n) { my $result := 1; if $n > 1 { $result := $n * factorial($n - 1); } $result; } say('5! = ', factorial(5));
Parrot | Parrot Compiler Toolkit | #54 |
sub factorial($n) { my $result := 1; if $n > 1 { $result := $n * factorial($n - 1); } $result; } say('5! = ', factorial(5));
Copyright © 2009 http://www.pmichaud.com/2009/pres/ |