Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
doc shaped Arrays
  • Loading branch information
gfldex committed Jun 29, 2016
1 parent d1a4741 commit 625fdb7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions doc/Language/list.pod
Expand Up @@ -382,6 +382,19 @@ an element type of C<Mu>, however its default value is an undefined C<Any>:
@n.default.perl.say; # says "Real"
@n[0].say; # says "(Real)"
=head2 Fixed Size Arrays
To limit the dimensions of an C<Array> provide the dimensions separated by C<,>
or C<;> in brackets after the name of the array container. The values of such
an C<Arrays> will default to C<Any>. The shape can be accessed at runtime via
the C<shape> method.
my @a[2,2];
dd @a;
# OUTPUT«Array.new(:shape(2, 2), [Any, Any], [Any, Any])␤»
say @a.shape;
# OUTPUT«(2 2)␤»
=head2 Itemization
For most uses, Arrays consist of a number of slots each containing a C<Scalar> of
Expand Down

0 comments on commit 625fdb7

Please sign in to comment.