On Wed 12 Mar, Michael Lazzaro wrote:
> 
> On Tuesday, March 11, 2003, at 12:39  PM, Austin Hastings wrote:
> > You want C<multi> to tell the compiler to build in multiple dispatch.
> > Any invocation of C<foo> after C<multi foo> is going to be a penny
> > dropped into the great Pachinko game of multimethod-dispatchery. By
> > default, if no winning multi appears, the call falls out the bottom and
> > winds up invoking the original sub().
> 
> OK, hmm.  What Damian is saying is that, tentatively, it's the 
> reverse... it calls the sub if theres a sub, then the multi if there's 
> a multi.  So overriding a sub with a multi wouldn't work, but it would 
> *silently* not work, because you could just never get to the multi 
> version (well, not without a bit of introspection).

Messy

> 
> I agree that the issue of overriding an inherited/preexisting C<sub> -- 
> like one from a CPAN module -- with a set of C<multi> implementations 
> is a useful capability; it would allow you to extend predefined 
> routines to handle different arguments without getting into OO.  But I 
> sure worry that it makes accidental redefinition of subs invisible in 
> many cases.
> 

Perhaps it should be possible to explicitly promote (or is it demote?):

sub factorial is multi;

Richard

-- 
Personal     [EMAIL PROTECTED]            http://www.waveney.org
Telecoms     [EMAIL PROTECTED]  http://www.WaveneyConsulting.com
Web services [EMAIL PROTECTED]            http://www.wavwebs.com
Independent Telecomms Specialist, ATM expert, Web Analyst & Services

Reply via email to