method skip

Documentation for method skip assembled from the following types:

class Any

From Any

(Any) method skip

Defined as:

multi method skip(--> Seq)
multi method skip($n --> Seq)

Creates a Seq from 1-item list's iterator and uses Seq.skip on it.

You can apply them to classes too, resulting in empty lists or lists that contain a single class. This is not a real use case, and it is mostly intended to show the calling syntax. Please note that calling skip without argument is equivalente to skip(1).

say Any.skip;      # OUTPUT: «()␤» 
say Any.skip(5);   # OUTPUT: «()␤» 
say Any.skip(-1);  # OUTPUT: «((Any))␤» 
say Any.skip(*-1); # OUTPUT: «((Any))␤» 

class Seq

From Seq

(Seq) method skip

Defined as:

multi method skip(Int() $n = 1 --> Seq)

Returns a Seq containing whatever is left of the invocant after throwing away $n of the next available values. Negative values of $n count as 0. Also can take a WhateverCode to indicate how many values to skip from the end. Will block on lazy Seqs until the requested number of values have been discarded.

say (1..5).map({$_}).skip;      # OUTPUT: «(2,3,4,5)␤» 
say (1..5).map({$_}).skip(3);   # OUTPUT: «(4,5)␤» 
say (1..5).map({$_}).skip(5);   # OUTPUT: «()␤» 
say (1..5).map({$_}).skip(-1);  # OUTPUT: «(1,2,3,4,5)␤» 
say (1..5).map({$_}).skip(*-3); # OUTPUT: «(3,4,5)␤» 

class Supply

From Supply

(Supply) method skip

method skip(Supply:D: Int(Cool$number = 1 --> Supply:D)

Returns a new Supply which will emit all values from the given Supply except for the first $number values, which will be thrown away.

my $supplier =;
my $supply = $supplier.Supply;
$supply = $supply.skip(3);
$supply.tap({ say $_ });
$supplier.emit($_for 1..10# OUTPUT: «4␤5␤6␤7␤8␤9␤10␤»