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
use nqp; | |
grammar fee { } | |
my $b := fee."!cursor_init"("bar",:0p); | |
say "simple grammar has a " ~ nqp::getattr($b,Cursor,"\$!braid").^name; | |
nqp::getattr($b, Cursor, '$!braid')."!dump"('fee'); | |
role foo { } | |
my $l := $?LANG; | |
my $NQPCursor; |
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
my $grammar := $*LANG.grammar(); | |
$grammar := $grammar.HOW.mixin($grammar, Control::Bail); | |
my $actions := $*LANG.actions(); | |
$actions := $actions.HOW.mixin($actions, Control::Bail::Actions); | |
try nqp::bindkey(%*LANG, 'MAIN', $grammar); | |
try nqp::bindkey(%*LANG, 'MAIN-actions', $actions); | |
try $*LANG.define_slang('MAIN', $grammar, $actions); |
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
- QAST::CompUnit :W<?> :UNIT<?> | |
[pre_deserialize] | |
- QAST::Stmt | |
- QAST::Stmt | |
- QAST::Op(loadbytecode) | |
- QAST::VM | |
[jvm] | |
- QAST::SVal(ModuleLoader.class) | |
[moar] | |
- QAST::SVal(ModuleLoader.moarvm) |
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
--- rakudobrew.bad 2015-12-18 14:28:24.903157342 -0800 | |
+++ rakudobrew 2015-12-18 14:29:04.107158046 -0800 | |
@@ -417,8 +417,7 @@ | |
run("$make $command"); | |
} | |
else { | |
- say STDERR "Couldn't determine correct make program. Aborting."; | |
- exit 1; | |
+ run("make $command"); | |
} |
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
proto sub infix:<foo>(|) is pure { * } | |
multi sub infix:<foo>(**@args is raw) { @args.minmax } | |
proto sub infix:<bar>(|) is pure { * } | |
multi sub infix:<bar>(+args) { args.minmax } | |
proto sub infix:<baz>(|) is pure { * } | |
multi sub infix:<baz>(+args) { 42; args.minmax } | |
my @a = 1,2,3,4; |
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
99-Bottles-of-Beer/99-bottles-of-beer-3.pl6 | |
9-billion-names-of-God-the-integer/9-billion-names-of-god-the-integer.pl6 | |
ABC-Problem/abc-problem.pl6 | |
Add-a-variable-to-a-class-instance-at-runtime/add-a-variable-to-a-class-instance-at-runtime-3.pl6 | |
Arithmetic-Integer/arithmetic-integer.pl6 | |
Balanced-brackets/balanced-brackets-1.pl6 | |
Balanced-brackets/balanced-brackets-4.pl6 | |
Bitwise-operations/bitwise-operations-1.pl6 | |
Bitwise-operations/bitwise-operations.pl6 | |
Bulls-and-cows-Player/bulls-and-cows-player.pl6 |
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
0 0 $*POD_BLOCKS | |
0 0 $*EXPORT | |
0 0 @*WORRIES | |
0 0 $*WAS_SKIPPED | |
2 0.667 $*POD_PAST | |
2 2 @*NQP_VIOLATIONS | |
8 2 $*UNIT_OUTER | |
14 2 $*purpose | |
16 16 @*MODULES | |
20 2 $*CONSTRAINT_USAGE |
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
my $cache := nqp::list_i(); | |
nqp::bindpos_i($cache, 650, 0); | |
nqp::bindpos_i($cache, 1, 1); | |
nqp::bindpos_i($cache, 89, 89); | |
sub Euler92(int $n) { | |
$n < 650 | |
?? nqp::bindpos_i($cache,$n,ids($n)) | |
!! ids($n) | |
} |
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
sub digits($n) { | |
my int $i = $n; | |
my int $b = 1000; | |
gather while $i { take $i % $b; $i = $i div $b } | |
} | |
constant narcissistic = map -> $d { | |
my @t = 0..9 X** $d; | |
my @table = @t X+ @t X+ @t; | |
sub is-narcissistic(\n) { n == [+] @table[digits(n)] } |
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
role BinaryTree[::T] { | |
has T $.value; | |
has BinaryTree[T] $.left; | |
has BinaryTree[T] $.right; | |
method replace-all(T $value) { | |
$!value = $value; | |
$!left.replace-all($value) if $!left.defined; | |
$!right.replace-all($value) if $!right.defined; | |
} |
NewerOlder