Skip to content

Commit

Permalink
Remove (:DEFAULT) and plan *.
Browse files Browse the repository at this point in the history
  • Loading branch information
colomon committed Feb 4, 2012
1 parent dbd0eb6 commit adf31e2
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 20 deletions.
16 changes: 8 additions & 8 deletions lib/List/Utils.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module List::Utils;

sub sliding-window(@a, $n) is export(:DEFAULT) {
sub sliding-window(@a, $n) is export {
my $a-list = @a.iterator.list;
my @values;
gather while defined(my $a = $a-list.shift) {
Expand All @@ -10,7 +10,7 @@ sub sliding-window(@a, $n) is export(:DEFAULT) {
}
}

sub sliding-window-wrapped(@a, $n) is export(:DEFAULT) {
sub sliding-window-wrapped(@a, $n) is export {
my $a-list = @a.iterator.list;
my @values;
gather {
Expand All @@ -28,7 +28,7 @@ sub sliding-window-wrapped(@a, $n) is export(:DEFAULT) {
}
}

sub permute(@items) is export(:DEFAULT) {
sub permute(@items) is export {
sub pattern_to_permutation(@pattern, @items1) {
my @items = @items1;
my @r;
Expand All @@ -55,7 +55,7 @@ sub permute(@items) is export(:DEFAULT) {
}
}

sub take-while(@a, Mu $test) is export(:DEFAULT) {
sub take-while(@a, Mu $test) is export {
gather {
for @a.list {
when $test { take $_ }
Expand All @@ -64,7 +64,7 @@ sub take-while(@a, Mu $test) is export(:DEFAULT) {
}
}

sub transpose(@list is copy) is export(:DEFAULT) {
sub transpose(@list is copy) is export {
gather {
while @list {
my @heads;
Expand All @@ -80,7 +80,7 @@ sub transpose(@list is copy) is export(:DEFAULT) {
}
}

sub lower-bound(@x, $key) is export(:DEFAULT) {
sub lower-bound(@x, $key) is export {
my $first = 0;
my $len = @x.elems;
my $half;
Expand All @@ -100,7 +100,7 @@ sub lower-bound(@x, $key) is export(:DEFAULT) {
return $first;
}

sub upper-bound(@x, $key) is export(:DEFAULT) {
sub upper-bound(@x, $key) is export {
my $first = 0;
my $len = @x.elems;
my $half;
Expand All @@ -120,7 +120,7 @@ sub upper-bound(@x, $key) is export(:DEFAULT) {
return $first;
}

sub sorted-merge(@a, @b, &by = &infix:<cmp>) is export(:DEFAULT) {
sub sorted-merge(@a, @b, &by = &infix:<cmp>) is export {
my $a-list = @a.iterator.list;
my $b-list = @b.iterator.list;

Expand Down
2 changes: 0 additions & 2 deletions t/01-sliding-window.t
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use Test;
use List::Utils;

plan *;

is ~sliding-window((1, 2, 3), 1), ~(1, 2, 3), "one at a time works (parcel)";
is ~sliding-window(1..3, 1), ~(1, 2, 3), "one at a time works (range)";
# is ~sliding-window(1...3, 1), ~(1, 2, 3), "one at a time works (series)";
Expand Down
3 changes: 0 additions & 3 deletions t/02-permute.t
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
use Test;
use List::Utils;

plan *;

{
my @a = permute((1, 2, 3));
say :@a.perl;
is @a.elems, 6, "(1, 2, 3) has 6 permutations";
}

Expand Down
2 changes: 0 additions & 2 deletions t/03-take-while.t
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use Test;
use List::Utils;

plan *;

is take-while((1...*), * <= 10), ~(1...10), "take-while works on a basic infinite loop";
is take-while((1...*), * <= -1), "", "take-while works if condition is initially false";

Expand Down
1 change: 0 additions & 1 deletion t/04-transpose.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use Test;
use List::Utils;

plan *;
nok transpose(([])).elems, "empty matrix";
is transpose(([],[])), (), "empty matrix";
is transpose(([1])), ([1]), "one element matrix";
Expand Down
2 changes: 0 additions & 2 deletions t/05-search.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ use v6;
use Test;
use List::Utils;

plan *;

my @array = (1, 2, 2, 3, 4, 5, 5, 5, 5, 6, 7, 8);

ok(([<=] @array), "array is sorted properly");
Expand Down
2 changes: 0 additions & 2 deletions t/06-sorted-merge.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ use v6;
use Test;
use List::Utils;

plan *;

{
my @a = (10, 20, 20, 30);
my @b = 17..22;
Expand Down

0 comments on commit adf31e2

Please sign in to comment.