Permalink
Browse files

[src/core] add .Set and .Bag to List and Parcel

  • Loading branch information...
masak committed May 21, 2013
1 parent ddaa3f6 commit a134b18ca72eaf5c902250674b6b8aa475748fe7
Showing with 21 additions and 0 deletions.
  1. +1 −0 docs/ChangeLog
  2. +10 −0 src/core/List.pm
  3. +10 −0 src/core/Parcel.pm
View
@@ -6,6 +6,7 @@ New in 2013.05
+ implemented Cool.lines
+ renamed IO to IO::Handle; IO is now a tag role, as per spec
+ simplify timezone handling
++ .Set and .Bag methods for List and Parcel
New in 2013.04
+ add Capture.Bool()
View
@@ -71,6 +71,16 @@ my class List does Positional {
nqp::p6parcel($rpa, Any);
}
+ proto method Set(|) {*}
+ multi method Set() {
+ set self;
+ }
+
+ proto method Bag(|) {*}
+ multi method Bag() {
+ bag self;
+ }
+
multi method at_pos(List:D: $pos is copy) is rw {
$pos = $pos.Int;
self.exists($pos)
View
@@ -116,6 +116,16 @@ my class Parcel does Positional {
method fmt($format = '%s', $separator = ' ') {
self.list.fmt($format, $separator);
}
+
+ proto method Set(|) {*}
+ multi method Set() {
+ set self;
+ }
+
+ proto method Bag(|) {*}
+ multi method Bag() {
+ bag self;
+ }
}

0 comments on commit a134b18

Please sign in to comment.