develooper Front page | perl.perl6.language | Postings from June 2001

RE: Multiple classifications of an object

Thread Previous | Thread Next
Dan Sugalski
June 27, 2001 10:48
RE: Multiple classifications of an object
Message ID:
At 09:57 AM 6/27/2001 -0700, David Whipp wrote:
>When I started this thread, I knew everyone would tell me that
>delegation is the answer: I included the note that I knew about
>that, but I guess the bias against MI is just too strong.

Well, not *everyone* is against it. :) And the current @ISA stuff is MI, 
albeit on a per-class basis rather than on a per-object one.

Anyway, as Damian mentioned, setting the .ISA property is a perfectly 
reasonable sort of thing to do if the language supports this. From an 
internals standpoint I'd ask that some serious thought as to the cost vs. 
benefit relation is given. This will have one of the following possible 

* Objects are bigger since they all need an .ISA property, if we toss the 
per-class @ISA
* Method lookup is slower and more complex, since we need to check for both 
a per-object and per-class ISA lookup
* We suck up more memory building fake classes (containing just an @ISA) 
for you behind the scenes

None of the possibilities are show-stoppers, of course--it's just a matter 
of which cost we want to pay for this.


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai                         have teddy bears and even
                                      teddy bears get drunk

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About