Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
List|Parcel.eager should only work on instances
  • Loading branch information
lizmat committed May 24, 2015
1 parent 0f0e73f commit 24aca6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/List.pm
Expand Up @@ -103,7 +103,7 @@ my class List does Positional { # declared in BOOTSTRAP
self.EXISTS-POS($pos) ?? nqp::atpos($!items,$pos) !! Nil;
}

method eager() { self.gimme(*); self }
multi method eager(List:D:) { self.gimme(*); self }

method elems() is nodal {
return 0 unless self.DEFINITE;
Expand Down
5 changes: 4 additions & 1 deletion src/core/Parcel.pm
Expand Up @@ -74,7 +74,10 @@ my class Parcel does Positional { # declared in BOOTSTRAP
method flat() is nodal { nqp::p6list(nqp::clone($!storage), List, Bool::True) }
method list() is nodal { nqp::p6list(nqp::clone($!storage), List, Mu) }
method lol() is nodal { nqp::p6list(nqp::clone($!storage), LoL, Mu) }
method eager() is nodal { nqp::p6list(nqp::clone($!storage), List, Mu).eager }

multi method eager(Parcel:D:) {
nqp::p6list(nqp::clone($!storage), List, Mu).eager;
}
method FOR(|c) {
if nqp::elems($!storage) == 1 and !nqp::isnull(nqp::atpos($!storage,0)) and !nqp::iscont(nqp::atpos($!storage,0)) {
try { nqp::atpos($!storage,0).map(|c) } // nqp::p6list(nqp::clone($!storage), List, Mu).map(|c);
Expand Down

0 comments on commit 24aca6a

Please sign in to comment.