Skip to content

Commit

Permalink
Clarify the status of "snip"
Browse files Browse the repository at this point in the history
And add tests
  • Loading branch information
lizmat committed Jun 1, 2024
1 parent 2d9cc77 commit 4aa457e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Revision history for ParaSeq
- Updated status of ".permutations" and added tests
- Updated status of ".produce" and added tests
- Updated status of ".slice" and added tests
- Updated status of ".snip" and added tests

0.0.7 2024-05-30T14:24:50+02:00
- Added optimized ".batch" and tests
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ slice

**Status**: the nature of the [`.slice`](https://docs.raku.org/type/Seq#multi_method_slice) method basically makes it impossible to hyper. Therefore, **no** specific hypering logic has been added for this method.

snip
----

**Status**: the nature of the [`.snip`](https://docs.raku.org/type/Any#routine_snip) method basically makes it impossible to hyper. Therefore, **no** specific hypering logic has been added for this method.

snitch
------

Expand Down
7 changes: 7 additions & 0 deletions doc/ParaSeq.rakudoc
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,13 @@ L<C<.slice>|https://docs.raku.org/type/Seq#multi_method_slice>
method basically makes it impossible to hyper. Therefore, B<no>
specific hypering logic has been added for this method.

=head2 snip

B<Status>: the nature of the
L<C<.snip>|https://docs.raku.org/type/Any#routine_snip> method
basically makes it impossible to hyper. Therefore, B<no> specific
hypering logic has been added for this method.

=head2 snitch

L<C<.snitch>|https://docs.raku.org/type/Any#routine_snitch>
Expand Down
19 changes: 19 additions & 0 deletions t/44-snip.rakutest
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use Test;
use ParaSeq;

plan 4;

my constant $elems = 200_000;
my constant @list = (^$elems).List;
my constant $snipper = (* mod 10) xx *;
my constant @snipped = @list.snip($snipper).List;
my constant $batch = 16;

for 1, ParaSeq.default-degree {
my $seq := @list.&hyperize($batch, $_).snip($snipper);
isa-ok $seq, $_ == 1 ?? Seq !! ParaSeq;
is-deeply $seq.List, @snipped,
".snip((* mod 10) xx *) with degree = $_";
}

# vim: expandtab shiftwidth=4

0 comments on commit 4aa457e

Please sign in to comment.