Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
2
Task/Metaprogramming/Raku/metaprogramming-1.raku
Normal file
2
Task/Metaprogramming/Raku/metaprogramming-1.raku
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
sub postfix:<!> { [*] 1..$^n }
|
||||
say 5!; # prints 120
|
||||
8
Task/Metaprogramming/Raku/metaprogramming-2.raku
Normal file
8
Task/Metaprogramming/Raku/metaprogramming-2.raku
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
use MONKEY-TYPING; # Needed to do runtime augmentation of a base class.
|
||||
|
||||
augment class List {
|
||||
method nsort { self.list.sort: {$^a.lc.subst(/(\d+)/, -> $/ {0 ~ $0.chars.chr ~ $0 }, :g) ~ "\x0" ~ $^a} }
|
||||
};
|
||||
|
||||
say ~<a201st a32nd a3rd a144th a17th a2 a95>.nsort;
|
||||
say ~<a201st a32nd a3rd a144th a17th a2 a95>.sort;
|
||||
2
Task/Metaprogramming/Raku/metaprogramming-3.raku
Normal file
2
Task/Metaprogramming/Raku/metaprogramming-3.raku
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
say "Foo = $foo\n"; # normal double quotes
|
||||
say Q:qq 【Foo = $foo\n】; # a more explicit derivation, new quotes
|
||||
Loading…
Add table
Add a link
Reference in a new issue