blocks

Run Settings
LanguageRaku
Language Version
Run Command
use MONKEY-SEE-NO-EVAL; multi sub postcircumfix:<{ }>(@args where *.map({.WHAT ~~ Pair}), &b) { b(|@args) } [a => 1, b => 2]{{my (\a, \b) = @_>>.value; say a + b }}; [:loop, :from(1), :to(5)]{{my ($expr, *%args) = @_; say $expr; say %args }}; sub ret-func($val) { return sub (&func) { func($val + 1) } } ret-func(1)(-> $a { say $a }); sub fn($val, &f) { f($val + 1) } fn 1, -> $a { say $a } say $_{\(1, 2, 3)}, $_{\<1 2 3>}, $_.pairs.sort(*.key) given {[1, 2, 3] => (4, 5, 6), [7, 8, 9] => <a b c>}; say ({:func{say $^a + 1}})<func>(1); #(Block: Block) sub func(@a, Block $b) { $b($_) for @a } [1, 2, 3].&func: -> $a {say $a + 1}; [4, 5, 6] [&func] -> $a {say $a + 1}; sub plus($a, $b) {say $a + $b} 1 [&plus] 2;
Editor Settings
Theme
Key bindings
Full width
Lines