> >What's wrong with multiple inheritance?
   > 
   > Nothing, but he wants MI on a per-object basis, rather than a per-class 
   > basis, presumably to avoid having to create a zillion classes who's sole 
   > purpose in life is to have an @ISA array.
   > 
   > Sounds sensible, and worth sending past Damian.

It's certainly not unreasonable, though it doesn't mesh perfectly with
Perl's OO model. The easy solution (available in Perl 5 too) is to
autogenerate the interim MI-ing classes as needed:

        my $next = "a";
        sub multibless {
                my ($ref, @classes) = @_;
                my $MIclass = "_MI_class_$next";
                $next++;
                @{$MIclass."::ISA"} = @classes;
                bless $ref, $MIclass;
        }

        # and later:

        my $schimmer = multibless {}, qw(Dessert_Topping Floor_Wax);


But one could also imagine that Perl 6 might allow individual objects to
have an C<ISA> property that pre-empted their class's C<@ISA> array.

Damian

Reply via email to