Permalink
Browse files

Add Parcel.Array and List.Array. There's probably a better way of doi…

…ng this, but this gets the job done for the moment.
  • Loading branch information...
1 parent 0d2a99e commit 136ddcf4f63d6d4fb3d6f779ad949376d2705bae @colomon colomon committed Oct 17, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/CORE.setting
View
@@ -1592,6 +1592,7 @@ my class Parcel is Cool does Positional {
}
@tok.join(" ");
}
+ method Array () { my @a = @(self); @a; }
method fmt($format = '%s', $separator = ' ') { # duplicates version in List
self.map({ .fmt($format) }).join($separator);
@@ -1680,6 +1681,8 @@ my class List is Cool does Positional {
method gist() { defined(self) ?? self.map(*.gist).join(" ") !! nextsame }
+ method Array () { my @a = @(self); @a; }
+
method sort($cmp_ = &infix:<cmp>) {
my $cmp = $cmp_;
if $cmp_.count == 1 {

0 comments on commit 136ddcf

Please sign in to comment.