Skip to content

Commit

Permalink
Make sub list/cache a multi
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Feb 26, 2018
1 parent eb06492 commit 838782b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/core/List.pm
Expand Up @@ -1505,7 +1505,11 @@ multi sub permutations(Int() $n) {
Seq.new(Rakudo::Iterator.Permutations($n,0))
}

sub list(+l) { l }
proto sub list(|) {*}
multi sub list(+l) { l }

proto sub cache(|) {*}
multi sub cache(+@l) { @l }

# Use **@list and then .flat it, otherwise we'll end up remembering all the
# things we flatten, which would be different semantics to .flat which gives
Expand All @@ -1515,8 +1519,6 @@ proto flat(|) {*}
multi flat(**@list is raw) { @list.flat }
multi flat(Iterable \a) { a.flat }

sub cache(+@l) { @l }

proto sub infix:<xx>(|) {*}
multi sub infix:<xx>() { Failure.new("No zero-arg meaning for infix:<xx>") }
multi sub infix:<xx>(Mu \x) { x }
Expand Down

0 comments on commit 838782b

Please sign in to comment.