> >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
- Multiple classifications of an object David Whipp
- Re: Multiple classifications of an object Gregory Williams
- Re: Multiple classifications of an object Michael G Schwern
- Re: Multiple classifications of an object Peter Scott
- Re: Multiple classifications of an object Dan Sugalski
- Re: Multiple classifications of an object Michael G Schwern
- RE: Multiple classifications of an object David Whipp
- Re: Multiple classifications of an object Damian Conway
- Re: Multiple classifications of an object John Porter
- ALLCAPS subs, properties, etc (Re: Multiple cla... Nathan Wiger
- Re: Multiple classifications of an object Trond Michelsen
- Re: Multiple classifications of an object Michael G Schwern
- Re: Multiple classifications of an object Damian Conway
- Re: Multiple classifications of an object David L. Nicol
- RE: Multiple classifications of an object David Whipp
- RE: Multiple classifications of an object Dan Sugalski
- Re: Multiple classifications of an object Bart Lateur
- Re: Multiple classifications of an object John Porter
