Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adds the list contextualizer @ refs #1711
  • Loading branch information
JJ committed Feb 14, 2019
1 parent 7ff36db commit aa50ea2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/Type/Any.pod6
Expand Up @@ -99,6 +99,18 @@ does the L<Positional|/type/Positional> role
from L«C<.list>|/routine/list». Use L«C<.List>|/routine/List» to
coerce specifically to L<List|/type/List>.
X<|@ list contextualizer>
C<@> can also be used as a list or positional contextualizer
=for code
my $not-a-list-yet = $[1,2,3];
say $not-a-list-yet.perl; # OUTPUT: «$[1, 2, 3]␤»
my @maybe-a-list = @$not-a-list-yet;
say @maybe-a-list.^name; # Array␤»
In the first case, the list is I<itemized>. C<@> as a prefix puts the initial
scalar in a list context by calling C<.list> and turning it into an array.
=head2 method push
Defined as:
Expand Down

0 comments on commit aa50ea2

Please sign in to comment.