langs a-z

This commit is contained in:
Ingy döt Net 2013-04-10 22:43:41 -07:00
parent db842d013d
commit d066446780
11389 changed files with 98361 additions and 1020 deletions

View file

@ -0,0 +1,2 @@
sub postfix:<!> { [*] 1..$^n }
say 5!; # prints 120

View file

@ -0,0 +1,8 @@
use MONKEY_TYPING; # Needed to do runtime augmentation of a base class.
augment class Any {
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;

View file

@ -0,0 +1,2 @@
macro addem($a,$b) { "($a + $b)" }
say addem(3,4); # 7

View file

@ -0,0 +1,2 @@
say "Foo = $foo\n"; # normal double quotes
say Q:qq Foo = $foo\n; # a more explicit derivation, new quotes