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


named argument key pair parsed as a Pair argument (incorrectly), and
vice versa (incorrectly), when called without parens

see http://dev.perl.org/perl6/doc/design/syn/S06.html#Named_arguments

13:23:15 <diakopter> rakudo: sub foo($w=4){say $w.perl}; foo 'w' => 3;
  # $w is positional (a Pair); this is correct, I think.
13:23:17 <?? exp_evalbot ??> OUTPUT[:w(3)␤]
13:20:52 <diakopter> rakudo: sub foo(%w){say %w.perl}; foo 'w' => 3;
# %w is positional (a Pair); this is correct, I think.
13:20:54 <?? exp_evalbot ??> OUTPUT[:w(3)␤]
13:23:33 <diakopter> rakudo: sub foo($w=4){say $w.perl}; foo w => 3;
# $w is a positional parameter, but w is passed as a named argument,
so this should fail with "not enough (positional) arguments"
13:23:39 <?? exp_evalbot ??> OUTPUT[:w(3)␤]
13:24:18 <diakopter> rakudo: sub foo(:$w=4){say $w.perl}; foo w => 3;
# $w is a named parameter ($w should be 3), but produces a Pair
(":w(3)")
13:24:19 <?? exp_evalbot ??> OUTPUT[:w(3)␤]

Reply via email to