Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
list and cache listops can now use +args
list is not guaranteed to produce a List now, since it can also
pass a Seq through unchanged.  Use List for a guarantee.
  • Loading branch information
TimToady committed Sep 20, 2015
1 parent 7173d13 commit 1b09de3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/core/List.pm
Expand Up @@ -913,9 +913,7 @@ multi infix:<,>(|) {
result
}

sub list(**@list is raw) {
@list == 1 ?? @list[0].list !! @list
}
sub list(+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 @@ -924,9 +922,7 @@ sub flat(**@list is raw) {
@list.flat
}

sub cache(**@list is raw) {
@list == 1 ?? @list[0].cache !! @list
}
sub cache(+@l) { @l }

proto sub infix:<xx>(|) { * }
multi sub infix:<xx>() { fail "No zero-arg meaning for infix:<xx>" }
Expand Down

0 comments on commit 1b09de3

Please sign in to comment.