So perl6 thinks it is an expression, With some kind of weird "comma" operator, Which returns a single thingy of some kind, That gets passed as a single argument to the function?
What is the comma operator doing And what is the return thingy of the expression? In perl5, this would have been at most list context of 123 and 455, which would have returned multiple items in a list, and would be visible in A perl 5 sub as $_[0] and $_[1]. Is list context gone in perl 6? Greg On Wed, February 17, 2016 11:04 am, Bill Ricker wrote: > That's an ambiguous parse for 1 arg vs 2 arg form, are the parents a > function call or an expression. Space disambiguates it: f( a, a2) is > function, f (a, a2) is an expression whose result is passed to the > function. > > On Wed, Feb 17, 2016 at 11:43 AM, Greg London <[email protected]> > wrote: > > >> >> Is perl6 whitespace sensitive? >> Or is this a bug? >> >> >> I have a multi() for 1 and 2 artuments >> But a 2 arg call ends up getting into the wrong sub >> Apparently because there is a space between the sub name and the >> Opening parenthesis? >> >> >> >> >> multi mysub($arg1) { say "mysub(one): $arg1"; } >> >> >> multi mysub($arg1, $arg2) { say "mysub(two): '$arg1' then '$arg2'"; } >> >> >> >> >> mysub(555); mysub(123, 456); mysub(999); mysub (123, 456); # a space >> between sub and parenthesis >> >> output: >> >> >> mysub(one): 555 >> mysub(two): '123' then '456' >> mysub(one): 999 >> mysub(one): 123 456 <== whoops! >> >> >> >> >> -- >> >> >> _______________________________________________ >> Boston-pm mailing list >> [email protected] >> http://mail.pm.org/mailman/listinfo/boston-pm >> >> > > > > -- > Bill Ricker > [email protected] https://www.linkedin.com/in/n1vux > > -- _______________________________________________ Boston-pm mailing list [email protected] http://mail.pm.org/mailman/listinfo/boston-pm

