# python like range
multi sub range($start, $stop, $step=1) {
(loop (my $i = $start; $i < $stop; $i += $step) {
$i
});
}
multi sub range($stop) {
range(0, $stop);
}
say range(10);
say range(2, 10);
say range(2, 10, 3);
say range(Inf);
say();
# basically the same (tim toady be like)
multi sub range2($start, $stop, $step=1) {
$start , (* + $step) ...^ (* >= $stop);
}
multi sub range2($stop) {
range2(0, $stop);
}
say range2(10);
say range2(2, 10);
say range2(2, 10, 3);
say range2(Inf);