Skip to content

Commit 09c424c

Browse files
committed
[List] key, values, kv
1 parent 3a341a7 commit 09c424c

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

lib/List.pod

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
77
C<List> stores items sequentially and potentially lazily.
88
9+
Indexes into lists and arrays start at 0 by default.
10+
911
=head2 Methods
1012
1113
=head3 elems
@@ -22,6 +24,34 @@ Returns the number of elements in the list
2224
2325
Returns the index of the last element
2426
27+
=head3 keys
28+
29+
multi sub keys(*@list) returns List:D
30+
multi method keys(List:D:) returns List:D
31+
32+
Returns a list of indexes into the list
33+
34+
=head3 values
35+
36+
multi sub values(*@list) returns List:D
37+
multi method values(List:D:) returns List:D
38+
39+
Returns a copy of the list.
40+
41+
=head3 kv
42+
43+
multi sub kv(*@list) returns List:D
44+
multi method kv(List:D:) returns List:D
45+
46+
Returns a list of indexes and values interleaved. For example
47+
48+
<a b c>.kv
49+
50+
Returns
51+
52+
0, 'a', 1, 'b', 2, 'c'
53+
54+
2555
=head3 join
2656
2757
multi sub join(Str:D $separator, *@list) returns Str:D

0 commit comments

Comments
 (0)