Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: What's so bad about &function(...)?

by Perl Mouse (Chaplain)
on Dec 09, 2005 at 22:46 UTC ( #515669=note: print w/replies, xml ) Need Help??


in reply to Re^2: What's so bad about &function(...)?
in thread What's so bad about &function(...)?

In Perl5, if you have arguments to a function, the parenthesis are optional if you don't use the & sigil (unless of course they are needed to prevent misparsing). However, if you use &foo to call a sub, and you want to call it with arguments, the parenthesis are mandatory.

Will you be able to do:

&foo 1, 2, 3
in Perl6?
Perl --((8:>*

Replies are listed 'Best First'.
Re^4: What's so bad about &function(...)?
by TimToady (Parson) on Dec 10, 2005 at 00:02 UTC
    Nope, Perl 6 still has to be picky about when it is expecting a term and when it is expecting an operator. It's vaguely possible we could allow
    &foo: 1, 2, 3
    however, since there are already other cases where a colon allows us to omit the parens. Can't say it's high on my list of priorities though.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://515669]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2021-03-05 16:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (113 votes). Check out past polls.

    Notices?