Skip to content

Instantly share code, notes, and snippets.

pmichaud@orange:~/ng$ ./perl6 --target=pir
> our $x = 3;
.HLL "perl6"
.namespace []
.sub "_block11" :anon :subid("10_1257026635.18483")
.annotate "line", 1
get_global $P13, "$x"
unless_null $P13, vivify_11
$ cat main.p6
multi sub MAIN ($mode where 'css') { say "You're in the CSS option"; }
multi sub MAIN () { say "You didn't enter an option"; }
multi sub MAIN ($mode, $arg) { say "You entered two command line arguments"; }
multi sub MAIN ($mode) { say "Unknown mode $mode"; }
$ ./perl6 main.p6
$ parrot_install/bin/parrot parrot_install/lib/1.5.0-devel/library/PGE/Perl6Grammar.pir --target=pir
> token foo { a* }
## <::foo>
.namespace []
.sub "foo" :method
.param pmc adverbs :unique_reg :slurpy :named
.local pmc mob
.local string target :unique_reg
.local pmc mfrom, mpos :unique_reg
pmichaud@plum:~/rakudo$ git diff
diff --git a/src/classes/Num.pir b/src/classes/Num.pir
index c282102..cdcc389 100644
--- a/src/classes/Num.pir
+++ b/src/classes/Num.pir
@@ -25,6 +25,12 @@ Num - Perl 6 numbers
.const 'Sub' $P0 = "Num::ACCEPTS"
$P1 = typeof numproto
$P1.'add_method'('ACCEPTS', $P0)
+
$ ./perl6
> my $a = 'aaaa'; $a ~~ m/.*(a).*(a).*/; { say @($/).map({ $_.from }).join: ","; $/.next } while $/;
2,3
1,3
1,2
1,2
0,3
0,2
0,2
0,1
$ cat A.pm
use B;
role A;
$ cat B.pm
role B;
$ ./perl6 A.pm
$
pmichaud@plum:~/rakudo$ make t/spec/S06-multi/type-based.t
ok 1 - dispatched to the Str sub
ok 2 - dispatched to the Int sub
ok 3 - dispatched to the Num sub
ok 4 - dispatched to the Bool sub
ok 5 - dispatched to the Rule sub
ok 6 - dispatched to the Sub sub
ok 7 - dispatched to the Array sub
ok 8 - dispatched to the Hash sub