@@ -247,13 +247,13 @@ fact that L<map|/routine/map> flattens out L<slips|/type/Slip> while C<nodemap>
247
247
248
248
Defined as:
249
249
250
- method flat(--> Seq:D ) is nodal
250
+ method flat() is nodal
251
251
252
252
Interprets the invocant as a list, flattens
253
- L < non-containerized|/language/containers > L < Iterable|/type/Iterable > s
254
- into a flat list, and returns that list. Keep in mind L < Map|/type/Map > and
255
- L < Hash|/type/Hash > types are L < Iterable|/type/Iterable > and so will be flattened into lists
256
- of pairs.
253
+ L < non-containerized|/language/containers > L < Iterable|/type/Iterable > s into a
254
+ flat list, and returns that list. Keep in mind L < Map|/type/Map > and
255
+ L < Hash|/type/Hash > types are L < Iterable|/type/Iterable > and so will be flattened
256
+ into lists of pairs.
257
257
258
258
say ((1, 2), (3), %(:42a)); # OUTPUT: «((1 2) 3 {a => 42})»
259
259
say ((1, 2), (3), %(:42a)).flat; # OUTPUT: «(1 2 3 a => 42)»
@@ -275,10 +275,10 @@ L<signature destructuring|/type/Signature#Destructuring_Parameters>
275
275
276
276
Defined as:
277
277
278
- method eager(--> Seq:D ) is nodal
278
+ method eager() is nodal
279
279
280
- Interprets the invocant as a L < List|/type/List > , evaluates it eagerly, and returns that
281
- L < List|/type/List > .
280
+ Interprets the invocant as a L < List|/type/List > , evaluates it eagerly, and
281
+ returns that L < List|/type/List > .
282
282
283
283
my $range = 1..5;
284
284
say $range; # OUTPUT: «1..5»
@@ -288,17 +288,24 @@ L<List|/type/List>.
288
288
289
289
Defined as:
290
290
291
- method elems(--> Int:D) is nodal
291
+ proto method elems(|) is nodal
292
+ multi method elems(Any:U: --> 1)
293
+ multi method elems(Any:D:)
292
294
293
295
Interprets the invocant as a list, and returns the number of elements in the
294
296
list.
295
297
296
298
say 42.elems; # OUTPUT: «1»
297
299
say <a b c>.elems; # OUTPUT: «3»
300
+ say Whatever.elems ; # OUTPUT: «1»
301
+
302
+ It will also return 1 for classes.
298
303
299
304
= head2 method end
300
305
301
- method end(--> Any:D) is nodal
306
+ proto method end(|) is nodal
307
+ multi method end(Any:U: --> 0)
308
+ multi method end(Any:D:)
302
309
303
310
Interprets the invocant as a list, and returns the last index of that list.
304
311
@@ -363,7 +370,7 @@ Coerces the invocant to L<List|/type/List>, using the L<list|/routine/list> meth
363
370
Defined as
364
371
365
372
proto method serial(|) is nodal
366
- multi method serial( --> Any )
373
+ multi method serial()
367
374
368
375
Returns the self-reference to the instance itself:
369
376
@@ -808,7 +815,7 @@ L<C<List.squish>|/type/List#routine_squish> for additional examples.
808
815
809
816
Defined as:
810
817
811
- method permutations(--> Seq )
818
+ method permutations(|c )
812
819
813
820
Coerces the invocant to a C < list > by applying its
814
821
L « C < .list > |/routine/list» method and uses
@@ -1143,7 +1150,7 @@ Returns an empty List.
1143
1150
1144
1151
Defined as:
1145
1152
1146
- method combinations(--> Seq )
1153
+ method combinations(|c )
1147
1154
1148
1155
Coerces the invocant to a C < list > by applying its L « C < .list > |/routine/list»
1149
1156
method and uses L « C < List.combinations > |/type/List#routine_combinations» on it.
@@ -1246,8 +1253,8 @@ the method C<list> on the instance.
1246
1253
1247
1254
Defined as:
1248
1255
1249
- multi method batch(Int:D $batch --> Seq )
1250
- multi method batch(Int:D :$elems --> Seq )
1256
+ multi method batch(Int:D $batch)
1257
+ multi method batch(Int:D :$elems! )
1251
1258
1252
1259
Coerces the invocant to a C < list > by applying
1253
1260
its L « C < .list > |/routine/list» method and uses
0 commit comments