File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -326,29 +326,36 @@ returns that L<C<List>|/type/List>.
326326 say $range; # OUTPUT: «1..5»
327327 say $range.eager; # OUTPUT: «(1 2 3 4 5)»
328328
329- =head2 method elems
329+ =head2 routine elems
330330
331331 multi method elems(Any:U: --> 1)
332332 multi method elems(Any:D:)
333+ multi elems($a)
334+ multi elems(array:D \a)
333335
334- Interprets the invocant as a list, and returns the number of elements in the
335- list.
336+ Interprets the invocant or argument as a list, and returns the number of
337+ elements in the list.
336338
337- say 42. elems; # OUTPUT: «1»
339+ say elems 42 ; # OUTPUT: «1»
338340 say <a b c>.elems; # OUTPUT: «3»
339341 say Whatever.elems ; # OUTPUT: «1»
340342
341343It will also return 1 for classes.
342344
343- =head2 method end
345+ =head2 routine end
344346
345347 multi method end(Any:U: --> 0)
346348 multi method end(Any:D:)
349+ multi end($a)
350+ multi end(array:D \a)
351+ multi end($, *%)
347352
348- Interprets the invocant as a list, and returns the last index of that list.
353+ Interprets the invocant or argument as a list, and returns the last index of
354+ that list.
349355
350356 say 6.end; # OUTPUT: «0»
351357 say <a b c>.end; # OUTPUT: «2»
358+ say end ^9; # OUTPUT: «8»
352359
353360=head2 method pairup
354361
You can’t perform that action at this time.
0 commit comments