On Fri, Jun 29, 2001 at 12:59:32PM -0800, Michael Fowler wrote:
> If you're relying on an overload isa() method to determine if something
> belongs to a given class you're going to run into problems.

There's no overloads, I never touched isa()!  It all just works!

LOOK AT CLASS::OBJECT!
http://www.pobox.com/~schwern/src/Class-Object-0.01.tar.gz

There's really not much going on.


> > > No, that's a lousy rule of thumb.  The tradeoffs must be considered.
> > > Otherwise we'd have Forth.  (Or Lisp, ca. 1960.)
> > 
> > What's the trade-off here?  It works, its efficient, the hacks are
> > well encapsulated.
> 
> The reason the feature (object-level ISA) was suggested in the first place
> was to solve the problem of multiple, pointless, only-there-to-set-@ISA,
> classes to serve MI.  How often is MI really used?  

Very often, for me anyway.  But object-as-class isn't really about MI.
You can solve the same problem using the technique Damian outlined,
using a special MI bless() that generates a little class on the fly.


> Would this solution greatly speed up MI?

In terms of performance, it will be just as fast.  In terms of
programming time, it might make a certain set of problems easier.
Having a way to do easy and fast delegation would help more IMHO.


> Would it greatly reduce the speed and memory
> efficiency of the large body of OO code that doesn't use MI?

I don't see how, in the core or out.  In fact, in the
object-inheritance scheme of things, every single object has to carry
around a bunch of information with it (what it inherits from, what
methods it has, etc...).  In essense, each object has to have its own
symbol table (or whatever the moral equivalent is in Perl 6) and thus
will be fatter than normal objects.

Though it sounds like Dan might be able to pull tricks that will
eliminate the need for this, at best they will be the same
weight/speed as any other object.  I can't see how they could possibly
be slimmer or faster.


-- 
Michael G Schwern   <[EMAIL PROTECTED]>   http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <[EMAIL PROTECTED]>       Kwalitee Is Job One

Reply via email to