Skip to content

Commit

Permalink
Make subs infix:<andthen>/<notandthen>/<orelse> multi's
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Mar 1, 2018
1 parent 25bedf8 commit e1b711a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/core/operators.pm
Expand Up @@ -656,7 +656,8 @@ sub REQUIRE_IMPORT($compunit, $existing-path,$top-existing-pkg,$stubname, *@syms
);
}

sub infix:<andthen>(+a) {
proto sub infix:<andthen>(|) {*}
multi sub infix:<andthen>(+a) {
# We need to be able to process `Empty` in our args, which we can get
# when we're chained with, say, `andthen`. Since Empty disappears in normal
# arg handling, we use nqp::p6argvmarray op to fetch the args, and then
Expand Down Expand Up @@ -687,7 +688,8 @@ sub infix:<andthen>(+a) {
True) # We were given no args, return True
}

sub infix:<notandthen>(+a) {
proto sub infix:<notandthen>(|) {*}
multi sub infix:<notandthen>(+a) {
# We need to be able to process `Empty` in our args, which we can get
# when we're chained with, say, `andthen`. Since Empty disappears in normal
# arg handling, we use nqp::p6argvmarray op to fetch the args, and then
Expand Down Expand Up @@ -718,7 +720,8 @@ sub infix:<notandthen>(+a) {
True) # We were given no args, return True
}

sub infix:<orelse>(+$) {
proto sub infix:<orelse>(|) {*}
multi sub infix:<orelse>(+$) {
# We need to be able to process `Empty` in our args, which we can get
# when we're chained with, say, `andthen`. Since Empty disappears in normal
# arg handling, we use nqp::p6argvmarray op to fetch the args, and then
Expand Down

0 comments on commit e1b711a

Please sign in to comment.