Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Last active June 10, 2017 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dogbert17/18e2818e5256147d38462f823397a70c to your computer and use it in GitHub Desktop.
Save dogbert17/18e2818e5256147d38462f823397a70c to your computer and use it in GitHub Desktop.
Attempt to doc Supply.skip
=head2 method skip
method skip(Supply:D: Int(Cool) $number = 1 --> Supply:D)
Returns a new C<Supply> which will emit all values from the given C<Supply>
except for the first C<$number> values, which will be thrown away.
=for code
my $supplier = Supplier.new;
my $supply = $supplier.Supply;
$supply = $supply.skip(3);
$supply.tap({ say $_ });
$supplier.emit($_) for 1..10; # OUTPUT: «4␤5␤6␤7␤8␤9␤10␤»
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment