Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sub signatures without parens?

4 views
Skip to first unread message

Juerd

unread,
Sep 4, 2004, 9:34:21 AM9/4/04
to perl6-l...@perl.org
for, while, given, loop, etcetera can all be used without parens. Are
the parens around the parameter specification still required? If so,
why? In other languages it may make sense because parens are required
when calling functions too, but in Perl, they're not.

sub foo $foo, *@bar {
...
}

You may find this ugly. I do think it's ugly, but wonder if it's
allowed.


Juerd

Larry Wall

unread,
Sep 4, 2004, 11:43:34 AM9/4/04
to perl6-l...@perl.org
On Sat, Sep 04, 2004 at 03:34:21PM +0200, Juerd wrote:
: for, while, given, loop, etcetera can all be used without parens. Are

How do we know that's not declaring an anonymous function where the
first parameter is of type "foo"? Also, as soon as you start applying
traits, they look like they belong to the final parameter. The computer
can probably figure most of these things out, but I think we need to
pity the human here.

Larry

0 new messages