Uri Guttman:
#   BD> Fine.  In Perl 5 we have a restriction on when you can 
# and can't use
#   BD> parens on a subroutine--you can omit them when the sub 
# is predeclared,
#   BD> and Perl will assume that no magic is going on.  I see 
# nothing wrong
#   BD> with this rule.
# 
# but you are conflating plain subs and method calls. perl6 can 
# deal with predeclared subs and fixed argument signatures at 
# compile time like perl5 can. but the same is not true in 
# either 5 nor 6 with method calls as they can only be looked 
# up at run time. the arguments passed to a method can be 

I'm speaking to the very specific case where the invocant is typed, so
we know the (base) type at compile time.

# checked then against know method signatures and maybe 
# multimethods could (dunno who or when that is decided. i 
# think the class has to be declared as having multimethods) be 
# invoked based on the arguments.
# 
# so the need for parens on method calls is there if you have 
# any possible compile time ambiguity of how many arguments to pass in.

But when you know the type beforehand, there shouldn't *be* any
ambiguity.  You can see the methods in that class, and you know how many
arguments the biggest implementation of a multimethod[1] takes.  Just
assume that that's the one being called.

Just to make things clear:

        class X {
                method x($a, $b) {
                }
                
                method x($a) {
                }
        }
        
        my  $obj1 = X.new;
        my X $obj2 .= new;
        
        $obj1.x $a;                     # syntax error (missing
parentheses on 
                                        # untyped method call, or
something like that)
        $obj2.x $a;                     # OK, like $obj2.x($a)
        
        $obj1.x $a, $b, $c;     # syntax error
        $obj2.x $a, $b, $c;     # OK, like $obj2.x($a, $b), $c

I do *not* expect Perl to do the impossible or even the very difficult.
This isn't even very difficult.

[1] Is there a word for the chunk of code associated with a certain
signature?

--Brent Dax <[EMAIL PROTECTED]>
@roles=map {"Parrot $_"} qw(embedding regexen Configure)

"If you want to propagate an outrageously evil idea, your conclusion
must be brazenly clear, but your proof unintelligible."
    --Ayn Rand, explaining how today's philosophies came to be


Reply via email to