Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert & fix "Revert ".eager shouldn't flatten" (breaks panda reboots…
…trap)"

This reverts commit 7b153f5.
.eager should actually be eager, even if it's called on a Parcel :P
More importantly, EAGER should actually eagerify its arguments. The
issue was that it was making a Parcel, passing the Parcel to Any.eager
to get flattened, and from there passed to List.eager. So we just make a flat
List instead and call List.eager.
  • Loading branch information
Mouq committed Mar 11, 2015
1 parent b56fc0b commit 79661ac
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/core/Any.pm
Expand Up @@ -57,10 +57,10 @@ my class Any { # declared in BOOTSTRAP

proto method eager(|) { * }
multi method eager(Any:U:) {
nqp::p6list(nqp::list(), List, Bool::True).eager;
nqp::p6list(nqp::list(), List, Mu).eager;
}
multi method eager(Any:D:) {
nqp::p6list(nqp::list(self), List, Bool::True).eager;
nqp::p6list(nqp::list(self), List, Mu).eager;
}

proto method hash(|) { * }
Expand Down
2 changes: 1 addition & 1 deletion src/core/List.pm
Expand Up @@ -646,7 +646,7 @@ my class List does Positional { # declared in BOOTSTRAP

# internal, caps to not hide 'eager' keyword
sub EAGER(|) {
nqp::p6parcel(nqp::p6argvmarray(), Any).eager
nqp::p6list(nqp::p6argvmarray(), List, Bool::True).eager
}

sub flat(|) {
Expand Down
1 change: 1 addition & 0 deletions src/core/Parcel.pm
Expand Up @@ -74,6 +74,7 @@ my class Parcel does Positional { # declared in BOOTSTRAP
method flat() { nqp::p6list(nqp::clone($!storage), List, Bool::True) }
method list() { nqp::p6list(nqp::clone($!storage), List, Mu) }
method lol() { nqp::p6list(nqp::clone($!storage), LoL, Mu) }
method eager() { nqp::p6list(nqp::clone($!storage), List, Mu).eager }

method reverse() {
my Mu $reverse := nqp::list();
Expand Down

0 comments on commit 79661ac

Please sign in to comment.