Skip to content

Commit

Permalink
Fix example code
Browse files Browse the repository at this point in the history
* additional my causes compile time error
* Follow style guide and use ^name instead of .WHAT
  • Loading branch information
coke committed Jan 3, 2020
1 parent 1a6e507 commit b56d604
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/Language/variables.pod6
Expand Up @@ -136,12 +136,12 @@ Assignment to a List container (list-context) always triggers list assignment:
my $f;
($f,) = 7,8,9; # list assignment to List with one element
say $f; # OUTPUT: «7␤»
say ( ($f,) ).VAR.WHAT; # OUTPUT: «(List)␤»
say ( ($f,) ).VAR.^name; # OUTPUT: «List␤»
# ATTENTION: special declaration syntax!
my ($g) = 7,8,9; # list assignment to List with one element
say $g; # OUTPUT: «7␤»
say ( my ($g) ).VAR.WHAT # OUTPUT: «(List)␤»
say ( ($g) ).VAR.^name # OUTPUT: «List␤»
The last two examples above are simple I<destructuring assignments> that select
the first item of the right-hand side list. See for a more elaborate discussion
Expand Down

0 comments on commit b56d604

Please sign in to comment.