Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (17 sloc) 562 Bytes
augment class Parcel {
method elems() { self.Seq.elems }
method list() { self.iterator }
method rotate(Int $n = 1) { self.Seq.rotate($n) }
multi method sort(&by = &infix:<cmp>) { self.Seq.sort(&by) }
multi method ACCEPTS($x) {
# smart-matching against Nil
if self.elems == 0 {
$x.notdef || ($x.does(::Positional) && $x == 0)
} else {
self.Seq.ACCEPTS($x)
}
}
multi method fmt($format = '%s', $seperator = ' ') {
self.map({ .fmt($format)}).join($seperator);
}
}
Jump to Line
Something went wrong with that request. Please try again.