RosettaCodeData/Task/Short-circuit-evaluation/Perl-6/short-circuit-evaluation.pl6
2016-12-05 22:15:40 +01:00

13 lines
244 B
Raku

use MONKEY-SEE-NO-EVAL;
sub a ($p) { print 'a'; $p }
sub b ($p) { print 'b'; $p }
for 1, 0 X 1, 0 -> ($p, $q) {
for '&&', '||' -> $op {
my $s = "a($p) $op b($q)";
print "$s: ";
EVAL $s;
print "\n";
}
}