home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / object / 3407 < prev    next >
Encoding:
Internet Message Format  |  1992-09-03  |  1.8 KB

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