home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.object:3407 comp.lang.clos:777
- Newsgroups: comp.object,comp.lang.clos
- Path: sparky!uunet!munnari.oz.au!metro!graham
- From: graham@maths.su.oz.au (Graham Matthews)
- Subject: Re: Implementation Question
- Message-ID: <graham.715515357@galois>
- Sender: graham@maths.su.oz.au
- Nntp-Posting-Host: galois.maths.su.oz.au
- Organization: School of Mathematics and Statistics, University of Sydney
- References: <graham.715435125@galois> <182ra0INN33d@early-bird.think.com> <hoelzle.715461389@Xenon.Stanford.EDU>
- Date: Thu, 3 Sep 1992 10:15:57 GMT
- Lines: 33
-
-
- Graham:
- >Now my problem is as follows. How do OO implentations handle the
- >space allocation for an instance of class B? Does an instance of B
- >have to have space allocated for all the instance variables in B as
- >well as all the instance variables in all the classes of which B is
- >a sub-class (in this case class A). I ask this for three reasons :-
-
- barmar@think.com (Barry Margolin) writes:
- >This is the distinction between inheriting behavior and structure.
- >Most OO languages use the same mechanism for both, thus making it
- >tricky to do what you want.
-
- (Urs Hoelzle) writes:
- >Exactly. And I can't resist mentioning that Self does The Right Thing
- >(TM) - with the nice side effect that no code ever depends on the
- >format of an object (i.e. whether is has an x instance variable or an
- >x method).
-
- There are two problems here :-
-
- a) often one wants to force the inheritance of behaviour (eg: all
- subclasses of a group class must have a multiplication method or
- they are not a subclass).
-
- b) code that does not depend on the format of an object is slow.
- In some application domains such code is unacceptably slow.
-
- graham
- --
- Graham Matthews And it's true we are immune
- Pure Math, Uni.Sydney, Oz When fact is fiction and T.V. is reality
- graham@maths.su.oz.au
-