Skip to content

Commit

Permalink
Simplify return/return-rw
Browse files Browse the repository at this point in the history
Not sure why we were saving the parameters to have them returned,
if we're returning them by exception already?
  • Loading branch information
lizmat committed Jun 11, 2016
1 parent 3d276a5 commit 2b76da0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
10 changes: 3 additions & 7 deletions src/core/Mu.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,13 @@ my class Mu { # declared in BOOTSTRAP
proto method split(|) { * }

method take {
take self;
take self
}
method return-rw(|) { # same code as control.pm's return-rw
my $list := RETURN-LIST(nqp::p6argvmarray());
nqp::p6routinereturn($list);
$list;
nqp::p6routinereturn(RETURN-LIST(nqp::p6argvmarray))
}
method return(|) { # same code as control.pm's return
my $list := RETURN-LIST(nqp::p6argvmarray());
nqp::p6routinereturn(nqp::p6recont_ro($list));
$list;
nqp::p6routinereturn(nqp::p6recont_ro(RETURN-LIST(nqp::p6argvmarray)))
}

proto method WHY(|) { * }
Expand Down
8 changes: 2 additions & 6 deletions src/core/control.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,10 @@ sub RETURN-LIST(Mu \list) is raw {
}

my &return-rw := -> | {
my $list := RETURN-LIST(nqp::p6argvmarray());
nqp::p6routinereturn($list);
$list;
nqp::p6routinereturn(RETURN-LIST(nqp::p6argvmarray))
};
my &return := -> | {
my $list := RETURN-LIST(nqp::p6argvmarray());
nqp::p6routinereturn(nqp::p6recont_ro($list));
$list;
nqp::p6routinereturn(nqp::p6recont_ro(RETURN-LIST(nqp::p6argvmarray)))
};

# RT #122732 - control operator crossed continuation barrier
Expand Down

0 comments on commit 2b76da0

Please sign in to comment.