langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
8
Task/Metaprogramming/Perl-6/metaprogramming-2.pl6
Normal file
8
Task/Metaprogramming/Perl-6/metaprogramming-2.pl6
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue