On Mon, Jul 09, 2001 at 10:37:47PM -0500, David L. Nicol wrote:
> Jeremy Howard wrote:
> \
> > Perl 5 didn't need templates, because there wasn't compile-time typing. But
> > with Perl 6 I want to send my compact array of integers to the same fast
> > sum() function as my compact array of floats, and not have to wait while
> > perl treats them both as old generic scalars.
<Snip>
>
> I haven't been tricked into reading MJD's article yet, but might your
> third option be multiple functions with parameter-type-based dispatch?
> We can do that with perl 5, but it isn't automatic.

The problem with polymorphic functions is you have to rewrite the
function N times (where N == the number of different types you want to
handle).  Its certainly a possiblity, it just seems rather inelegant.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <[EMAIL PROTECTED]>       Kwalitee Is Job One
I have this god-awful need to aquire useless crap!!!

Reply via email to