We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c798ff6 commit 8e673dbCopy full SHA for 8e673db
doc/Type/Array.pod6
@@ -94,6 +94,23 @@ Example:
94
say @a.elems; # OUTPUT: «6»
95
say @a; # OUTPUT: «[a b c d e f]»
96
97
+=head2 method elems
98
+
99
+Defined as:
100
101
+ method elems(Array:D: --> Int:D)
102
103
+Returns the number of elements in the invocant. Throws C<X::Cannot::Lazy>
104
+exception if the invocant L<is lazy|/routine/is-lazy>. For shaped arrays,
105
+returns the outer dimension; see L<shape> if you need information for
106
+all dimensions.
107
108
+ say [<foo bar ber>] .elems; # OUTPUT: «3»
109
+ say (my @a[42;3;70]).elems; # OUTPUT: «42»
110
111
+ try [-∞...∞].elems;
112
+ say $!.^name; # OUTPUT: «X::Cannot::Lazy»
113
114
=head2 method clone
115
116
Defined as:
0 commit comments