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

Re: S6 multimethod invocants

Thread Previous | Thread Next
From:
Luke Palmer
Date:
April 11, 2003 08:32
Subject:
Re: S6 multimethod invocants
Message ID:
ygcu1d58363.fsf@babylonia.flatirons.org
> Ok, this is strange to me.
> 
>   multi handle_event ($window, $event: $mode) {...}    # two invocants
> 
> Does that mean I can assume $event is a valid object of some sort?

Yep. 

    multi handle_event ($window, Undef $event: $mode) {...}

Then you would get a valid undef object. :)

>   .stuff() 
> 
> is still going to default to $window, right?

Yes.  $_ binds to the first invocant.

> Or is that saying that if there is no $window.stuff() it'll look for
> $event.stuff() ?

No.  If there's no $window.stuff, you'll get an error.

Luke

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