--- Luke Palmer <fibonaci@babylonia.flatirons.org> wrote:
> > 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. :)
okay....and why would I want that?
> > .stuff()
> > is still going to default to $window, right?
>
> Yes. $_ binds to the first invocant.
Okay, that makes expected sense....
> > 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.
Okay, but I thought the main point of multimethods was that it could be
redefined and would be dynamically dispatched to the correct version
based on the invocant and/or arguments, i.e., the signature.
What, exactly, is the value of calling multiple arguments to one method
call "invocants"? I'm *really* missing something, here.....
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com
Thread Previous
|
Thread Next