This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat A.pm | |
use B; | |
role A; | |
$ cat B.pm | |
role B; | |
$ ./perl6 A.pm | |
$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |