2015-11-18 06:14:39 +00:00
|
|
|
use MONKEY-TYPING; # Needed to do runtime augmentation of a base class.
|
2013-04-10 22:43:41 -07:00
|
|
|
|
2015-11-18 06:14:39 +00:00
|
|
|
augment class List {
|
|
|
|
|
method nsort { self.list.sort: {$^a.lc.subst(/(\d+)/, -> $/ {0 ~ $0.chars.chr ~ $0 }, :g) ~ "\x0" ~ $^a} }
|
2013-04-10 22:43:41 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
say ~<a201st a32nd a3rd a144th a17th a2 a95>.nsort;
|
|
|
|
|
say ~<a201st a32nd a3rd a144th a17th a2 a95>.sort;
|