Skip to content

Commit c1b7948

Browse files
committed
Document List.gist
1 parent 6f58ed0 commit c1b7948

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

doc/Type/List.pod6

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,30 @@ Unlike C<map> it flattens non-itemized lists and arrays, so
258258
259259
invokes L<uc|/type/Str#routine_uc> four times.
260260
261+
=head2 method gist
262+
263+
Defined as:
264+
265+
multi method gist(List:D: --> Str:D)
266+
267+
Returns the string containing the parenthesized "gist" of the List,
268+
B<listing up to the first 100> elements, separated by space, appending an
269+
ellipsis if the List has more than 100 elements. If List
270+
L«C<is-lazy>|/routine/is-lazy», returns string C«'(...)'»
271+
272+
=begin code
273+
put (1, 2, 3).gist; # OUTPUT «(1 2 3)␤»
274+
put (1..∞).List.gist; # OUTPUT «(...)␤»
275+
276+
put (1..200).List.gist;
277+
# OUTPUT:
278+
# (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
279+
# 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
280+
# 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
281+
# 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
282+
# 96 97 98 99 100 ...)
283+
=end code
284+
261285
=head2 routine grep
262286
263287
Defined as:

0 commit comments

Comments
 (0)