> if( # would not introduce a function call to a function called "if"
> foo (1,2) # would stop passing a single list to a sub called foo.

To clarify, the idea was that *if* an identifier was followed by parens,
and *if* that identifier existed as a function name/subroutine name/multi name,
*then* the first set of parens would be for holding the arguments. 

If the code wants to pass a single list, then enclose it in a second set of 
parens.
This simple rule removes *whitespace* as being the critical distinction for 
what the code does.
It also makes it much more clear because two sets of parens tells you something 
is going on far more than " " <== that does.

The idea was not to say any identifier followed by parens be treated as a 
function.
i.e.   "if()" would call a function called "if" only if it existed as a 
function. if NOT, then treat it as an expression.

If I have code with a function mysub  in it, and then later perl adds a "mysub" 
keyword, 
then mysub() would always call a the mysub function so long as it exists in the 
code.




-----Original Message-----
From: Tobias Leich via RT [mailto:perl6-bugs-follo...@perl.org] 
Sent: Tuesday, February 23, 2016 12:03 PM
To: London Greg (IFAM PMM DCDC IC2 DD)
Subject: [perl #127598] white space affects which multiple dispatch subroutine 
is getting called.

Hi, please consider using this slang which will most likely give you what you 
need:

  https://github.com/FROGGS/p6-Slang-Tuxic

But the short answer here is that the function call syntax wont change anymore.
Some examples that would break when we would change it:

if( # would not introduce a function call to a function called "if"
foo (1,2) # would stop passing a single list to a sub called foo.

The first shown example is important. Perl 6 does not want to reserve special 
keywords today and in future that ban functions of the same name. So there is 
syntax (whitespace) that disambiguates.
Image you have a function called mysub today in your enterprise application, 
and we make it a keyword in Perl 6.d. With your approach your code would break, 
with our approach a function call like mysub() would still work out.

Reply via email to