constant term:<$ab> = $; say $ab;
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 a() { say $*foo; b() } | |
sub b() { return if $++ ≥ 3; a(); my Any:D $*foo = 42; } | |
my $*foo = 10; | |
a(); | |
say $*foo; | |
# OUTPUT: | |
# 10 | |
# (Any) |
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
my atomicint $spawn-limit = 8; | |
sub spawn(&c, |args) { | |
# dd ⚛$spawn-limit; | |
⚛$spawn-limit > 0 | |
?? ($spawn-limit⚛-- ;start { LEAVE $spawn-limit⚛++; c(|args) }) | |
!! c(|args) | |
} | |
sub collect(*@things) { | |
slip @things.map: -> $thing { $thing ~~ Promise ?? await $thing !! $thing } |
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
my atomicint $limit = 8; | |
sub spawn(&c, |args) { | |
# dd $limit; | |
⚛$limit > 0 | |
?? start { ENTER $limit⚛--; LEAVE $limit⚛++; c(|args) } | |
!! c(|args) | |
} | |
sub collect(*@things) { | |
slip @things.map: -> $thing { $thing ~~ Promise ?? await $thing !! $thing } |
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
constant &auto-enum = BEGIN (Q:to /◻/).EVAL; | |
proto sub quasi-enum($str, |opts ( :$DEFAULT, :$SOURCEPOS, :$HARDBREAKS, :$UNSAFE, :$NOBREAKS, :$NORMALIZE, :$VALIDATE_UTF8, :$SMART, :$GITHUB_PRE_LANG, :$LIBERAL_HTML_TAG, :$FOOTNOTES, :$STRIKETHROUGH_DOUBLE_TILDE, :$TABLE_PREFER_STYLE_ATTRIBUTES, :$FULL_INFO_STRING )) { | |
constant %CMARK_OPTIONS = | |
DEFAULT => 0, | |
SOURCEPOS => 1 +< 1, | |
HARDBREAKS => 1 +< 2, | |
UNSAFE => 1 +< 17, | |
NOBREAKS => 1 +< 4, | |
NORMALIZE => 1 +< 8, | |
VALIDATE_UTF8 => 1 +< 9 , |
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
class C { | |
method m(Int $i) { } | |
method new(::?CLASS:U: *%extra-methods) { | |
my $replacer = my role :: {}; | |
for %extra-methods.kv -> $name, $code { | |
$replacer.^add_method($name, $code) if $code.signature ~~ self.^lookup($name).signature; | |
} | |
$replacer.^compose; | |
callwith() but $replacer |
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
export PATH="/usr/local/src/rakudo/install/share/perl6/site/bin:/usr/local/src/rakudo/install/bin:$PATH" | |
export RAKUDO_MAX_THREADS=16 | |
export RAKUDO_ERROR_COLOR=yes | |
export TEST_JOBS=12 | |
export ZEF_TEST_DEGREE=12 |
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
role Perl6::Metamodel::MultipleInheritance { | |
# Array of parents. | |
has @!parents; | |
# MARK | |
has @!children; | |
method add_child($obj, $child) { | |
say($obj.HOW.name($child)); | |
say($obj.HOW.HOW.name($child)); |
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
use v6.d; | |
use lib '.'; | |
use seepy 'seepy'; | |
seepy Root { } | |
seepy Base is Root { | |
} |
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
<html><body><div class='index'> | |
<div class='entry'><a href="issues.html#374"><span class='number'>374</span></a> [open] <span class='title'>Errors should not be adhoc in core</span></div> | |
<div class='entry'><a href="issues.html#370"><span class='number'>370</span></a> [open] <span class='title'>A way around "multi-level classification"</span></div> | |
<div class='entry'><a href="issues.html#366"><span class='number'>366</span></a> [open] <span class='title'>`next`, `last`, `redo` shouldn't fall through subroutines</span></div> | |
<div class='entry'><a href="issues.html#362"><span class='number'>362</span></a> [open] <span class='title'>Expand DEPRECATED functionality.</span></div> | |
<div class='entry'><a href="issues.html#369"><span class='number'>369</span></a> [open] <span class='title'>Provide `sort` with `:k` adverb (returns ordinal index)</span></div> | |
<div class='entry'><a href="issues.html#368"><span class='number'>368</span></a> [open] <span class='title'>LinkedIn does not recognize "Raku Developer" as a job |