develooper Front page | perl.perl6.language | Postings from April 2003

Re: S6 multimethod invocants

Thread Previous | Thread Next
From:
Larry Wall
Date:
April 14, 2003 11:55
Subject:
Re: S6 multimethod invocants
Message ID:
20030414180205.GA2232@wall.org
On Mon, Apr 14, 2003 at 11:02:01AM +1000, Damian Conway wrote:
: Paul wrote:
: 
: >whoa....
: >
: >  multi foo ($me: Int $x) {...}
: >  multi foo ($me: Dog $x) {...}
: >
: >doesn't work to delegate by sig? I must've *REALLY* misread something
: >somewhere....
: 
: Yep. You missed the bit that says that multimethods only dispatch on their 
: invocants (i.e. the parameters declared before the colon). What you wrote 
: would probably induce a compile-time error:
: 
: 	Inconsistent declaration of multi foo($me:...)
 
Actually, the problem is that they're consistent, not inconsistent.  Perhaps:

    Undifferentiated declarations of multi foo($me:...)

On the other hand, it might just fall into the category of:

    Redeclaration of &foo($:) at line 123...

Larry

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About