# New Ticket Created by  Stephane Payrard 
# Please include the string:  [perl #126712]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=126712 >


Is it supported?
What is the syntax?
My attempts to use it fail even if the same examle works when used in a 
function call.

See http://irclog.perlgeek.de/perl6/2015-11-23#i_11584099

cognominal      m: my ($a, [$b] ) = 42, [666]; say $a.perl, $b.perl
08:58   camelia rakudo-moar : OUTPUT«Cannot call method 'perl' on a null 
object␤  in block <unit> at /tmp/OYD735wn7W:1␤␤»
08:59   cognominal      m: my :($a, [$b] ) = 42, [666]; say $a.perl, $b.perl
08:59   camelia rakudo-moar : OUTPUT«5===SORRY!5=== Error while compiling 
/tmp/gGoNLw1mB0␤Malformed my␤at /tmp/gGoNLw1mB0:1␤------> 3my7⏏5 :($a, [$b] ) = 
42, [666]; say $a.perl, ␤»
08:59   cognominal      is it possible to do destructuring without calling a 
function ?
09:01           not sure what the first expression really does btw.
2 more elements. Show/hide.
09:11   masak   cognominal: if that's not in RT, please put it there.
09:11   cognominal      m: my ($a, [$b] ) = 42, [666]; say $a, $b
09:11   camelia rakudo-moar : OUTPUT«42(Mu)␤»
09:11masak      cognominal: and no, the synopses don't mention that kind of 
destructuring assignment at all.
09:16           only destructuring through subsignatures.
09:18   cognominal      m: sub fun($a, [$b] ){ say $a, $b }; fun( 42, [666]);
09:18   camelia    <camelia> rakudo-moar : OUTPUT«42666␤»

Reply via email to