You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OK, this is a pitfall, because our docs are full of this:
doc/Language/5to6-nutshell.pod6: say %calories«$key»; # Perl 6 - double angles interpolate as a list of Str
doc/Language/5to6-nutshell.pod6: say join ',', %calories«$keys»; # Perl 6 the split is done after interpolation
doc/Language/operators.pod6: say %color«cherry $fruit».perl; # OUTPUT: «("red", "green")»
doc/Language/rb-nutshell.pod6: say %calories«$key»; # Perl 6 - double angles interpolate as double-quotes
doc/Language/rb-nutshell.pod6: say %calories«$keys».join(','); # Perl 6, interpolated split
doc/Language/subscripts.pod6: %hash«foo $var»; # same as %hash{ «foo $var» }
doc/Type/Hash.pod6: dd %h«oranges $fruit»;
I've never seen this before, and I'm actually surprised that somebody came up with this (edit: actually, our docs suggested it).
Code:
Result:
So it works, right? Wrong.
Code:
Result:
Of course, the right way to do it is to use
%h{$x}. If you insist on«»for some reason, then%h«“$x”».See this: https://irclog.perlgeek.de/perl6/2017-06-07#i_14699923
The text was updated successfully, but these errors were encountered: