home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / smalltal / 2836 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.7 KB  |  40 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!munnari.oz.au!sgiblab!sdd.hp.com!usc!howland.reston.ans.net!paladin.american.edu!auvm!OPEN.AC.UK!J.G.B.HEAL
  3. Via:        UK.AC.OPEN; 27 JAN 93  9:40:38 GMT
  4. Message-ID: <9301270939.AA29655@bean.open.ac.uk>
  5. Newsgroups: comp.lang.smalltalk
  6. Date:         Wed, 27 Jan 1993 09:39:11 GMT
  7. Sender:       SmallTalk programming language discussion <SMALK@FINHUTC.BITNET>
  8. From:         J.G.B.Heal@OPEN.AC.UK
  9. Subject:      Re: Voluntary method typing in ST80
  10. Lines: 28
  11.  
  12. >
  13.  
  14. >
  15. >Faced with a similar problem, I defined a method Class>>accessMethods which
  16. >ran through all the instance variables of a class and defined get and
  17. >set methods for those instance names. Much simpler and much more
  18. >performant. There is a reason for compilers, after all. If you do this,
  19. >Make sure that the generated text contains comments indicating that it is
  20. >mechanically generated, so that later you (or others) won't modifiy the
  21. >method and then lose the modification when accessMethods is rerun.
  22.  
  23.  
  24. thanks - I agree your solution is neater/faster etc.  I suppose I just have
  25. a bete-noire about compilation and freezing the type information.  The only
  26. merit of my scheme (as with all interpreted ones) is that I can dynamically
  27. extend the range of 'instance variables'.  e.g. if from time t3 I need to
  28. have a variable 'x' I just send it a setX:99 message.  I don't need to
  29. recompile.  You could recompile, but I'm not sure how to preserve existing
  30. instances (say compiled with 3 instance variables) into a world of 4
  31. instance variables.  Any thoughts about this?
  32.  
  33.  
  34. ------
  35. Benedict Heal                          tel: (0908) 652695
  36. Faculty of Mathematics                 e-mail: j.g.b.heal@open.ac.uk
  37. The Open University
  38. Milton Keynes
  39. MK7 6AA U.K.
  40.