With the possibility of making this thread off-topic: isn't multi-method a
function that propogates according to the values of more than one
argument? Like:

sub myfunc
{
        my ($a, $b) = @_;

        if ($a->isa('Vector3') && $b->isa('Vector3'))
        {
                return Vector3::myfunc($a,$b);
        }
        elsif ($a->isa('Vector') && $b->isa('Vector'))
        {
                return Vector::myfunc($a,$b);
        }
        elsif ...
        .
        .
        .
}

The way I see it, it can also be implemented in user-land, but of course
if it's not parrotized then there will be some duplicate code around. Now,
there may be more complicated situation. Like a variable number of
parameters each one of them a class of a certain type ("grep { !
$class->isa('Vector'} } @_" or something of this vain. ), etc.

We probably should figure out what kind of multimethods are commonly used
in the languages we plan Parrot to be suitable for, and in perl6, and
decide what to have according to this. The user can complement the rest in
user-land.[1]

Regards,

        Shlomi Fish


[1] - I'm working on a pet dialect of Perl which I call Rindolf. Since it
will be mostly based on Perl 5, I plan to default on the user implement
multi-methods in user-land where he finds appropriate. I think it's more
flexible that way.

Regards,

        Shlomi Fish
 --


----------------------------------------------------------------------
Shlomi Fish        [EMAIL PROTECTED]
Home Page:         http://t2.technion.ac.il/~shlomif/
Home E-mail:       [EMAIL PROTECTED]

He who re-invents the wheel, understands much better how a wheel works.

Reply via email to