This file contains hidden or 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
| # These are all equivalent: a list of three Pairs | |
| @foo = 'one' => 1, 'two' => 'ii', 'one' => { say "ॐ" } | |
| @foo = one => 1, two => 'ii', one => { say "ॐ" } | |
| @foo = :one(1), :two<ii>, :one({ say "ॐ" }) |
This file contains hidden or 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
| sub foo (*@positional, *%named) { | |
| @positional.perl.say; | |
| %named.perl.say; | |
| } | |
| # Result: ('one' => 1, 'two' => 'ii', 'one' => Block).list, ().hash | |
| foo('one' => 1, 'two' => 'ii', 'one' => { say "ॐ" }) | |
| # Result: ().list, ('two' => 'ii', 'one' => Block).hash | |
| foo(one => 1, two => 'ii', one => { say "ॐ" }) |
This file contains hidden or 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
| .gist { | |
| color: #000000; | |
| } | |
| .gist div { | |
| margin: 0; | |
| padding: 0; | |
| } | |
| .gist .gist-file { | |
| border: 1px solid #DEDEDE; | |
| font-family: Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",monospace; |
This file contains hidden or 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
| # vim:set ft=perl6: | |
| my %foo; | |
| %foo<a> = 'a' => []; | |
| %foo<b> = 'b' => []; | |
| push %foo<a>.value, %foo<b>; | |
| # Rakudo and niecza will never return from .perl method | |
| push %foo<b>.value, %foo<a>; | |
| note "Before .perl"; |
This file contains hidden or 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
| #! /usr/bin/env perl6 | |
| #use Grammar::Tracer; | |
| grammar PandaInfo { | |
| regex TOP { <pkginfo>* { make [$<pkginfo>».made] } } | |
| regex pkginfo { [ | |
| | <notfound> { make $<notfound>.made } | |
| | | |
| <name> <descr> <info>* { |
This file contains hidden or 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
| #! /usr/bin/env perl6 | |
| v6; | |
| sub MAIN() { | |
| use lib './ext/xyz/bin'; | |
| use xyz <foo>; | |
| my $foo = foo(); | |
| say "Testy says: $foo!"; | |
| } |
This file contains hidden or 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
| #! /usr/bin/env perl6 | |
| constant $me = 'YOUR-GITHUB-USER'; | |
| constant $token = 'YOUR-GITHUB-OAUTH-TOKEN'; | |
| sub MAIN(Bool :n(:$dry-run) = False) { | |
| my %remotes; | |
| for qqx<< git remote -v >>.lines { | |
| / | |
| ^ (<-[\t]>+) |
This file contains hidden or 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
| tmp/ | |
| cache/ |
This file contains hidden or 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
| #! /usr/bin/env perl6 | |
| use Shell::Command; | |
| constant $top = './tmp/junk'; | |
| sub MAIN (:$workers = 5, :$levels = '20, 3, 5', Bool :$force = False, Bool :$create-only = False) { | |
| create-junk($levels.comb(/\d+/)) if $force or not $top.IO.d; | |
| remove-junk($workers) unless $create-only; | |
| note "# DONE"; |
This file contains hidden or 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
| #! /usr/bin/env perl6 | |
| use v6; | |
| my $output = Supply.new; | |
| $output.act(*.note); | |
| my @workers = do for ^5 -> $id { | |
| start { | |
| for ^5 -> $iter { |