Skip to content

Commit 72e179f

Browse files
committed
Document .skip(WhateverCode)
1 parent c625923 commit 72e179f

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

doc/Type/Any.pod6

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,10 @@ Defined As:
562562
Creates a Seq from 1-item list's iterator and uses
563563
L«C<Seq.skip>|/type/List#method_skip» on it.
564564
565-
say Any.skip; # OUTPUT: «()␤»
566-
say Any.skip(5); # OUTPUT: «()␤»
567-
say Any.skip(-1); # OUTPUT: «((Any))␤»
565+
say Any.skip; # OUTPUT: «()␤»
566+
say Any.skip(5); # OUTPUT: «()␤»
567+
say Any.skip(-1); # OUTPUT: «((Any))␤»
568+
say Any.skip(*-1); # OUTPUT: «((Any))␤»
568569
569570
=head2 method prepend
570571

doc/Type/Seq.pod6

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,16 @@ Defined As:
125125
multi method skip(Int() $n = 1 --> Seq)
126126
127127
Returns a Seq containing whatever is left of the invocant after
128-
throwing away C<$n> of the next available values. May (and
129-
probably will) return the invocant itself. Negative values of
130-
C<$n> count as 0. Will block on lazy Seqs until the requested
128+
throwing away C<$n> of the next available values. Negative values of
129+
C<$n> count as 0. Also can take a WhateverCode to indicate how many values
130+
to skip from the end. Will block on lazy Seqs until the requested
131131
number of values have been discarded.
132132
133-
say (1..5).map({$_}).skip; # OUTPUT: «(2,3,4,5)␤»
134-
say (1..5).map({$_}).skip(3); # OUTPUT: «(4,5)␤»
135-
say (1..5).map({$_}).skip(5); # OUTPUT: «()␤»
136-
say (1..5).map({$_}).skip(-1); # OUTPUT: «(1,2,3,4,5)␤»
133+
say (1..5).map({$_}).skip; # OUTPUT: «(2,3,4,5)␤»
134+
say (1..5).map({$_}).skip(3); # OUTPUT: «(4,5)␤»
135+
say (1..5).map({$_}).skip(5); # OUTPUT: «()␤»
136+
say (1..5).map({$_}).skip(-1); # OUTPUT: «(1,2,3,4,5)␤»
137+
say (1..5).map({$_}).skip(*-3); # OUTPUT: «(3,4,5)␤»
137138
138139
=end pod
139140

0 commit comments

Comments
 (0)