home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- 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
- Via: UK.AC.OPEN; 27 JAN 93 9:40:38 GMT
- Message-ID: <9301270939.AA29655@bean.open.ac.uk>
- Newsgroups: comp.lang.smalltalk
- Date: Wed, 27 Jan 1993 09:39:11 GMT
- Sender: SmallTalk programming language discussion <SMALK@FINHUTC.BITNET>
- From: J.G.B.Heal@OPEN.AC.UK
- Subject: Re: Voluntary method typing in ST80
- Lines: 28
-
- >
-
- >
- >Faced with a similar problem, I defined a method Class>>accessMethods which
- >ran through all the instance variables of a class and defined get and
- >set methods for those instance names. Much simpler and much more
- >performant. There is a reason for compilers, after all. If you do this,
- >Make sure that the generated text contains comments indicating that it is
- >mechanically generated, so that later you (or others) won't modifiy the
- >method and then lose the modification when accessMethods is rerun.
-
-
- thanks - I agree your solution is neater/faster etc. I suppose I just have
- a bete-noire about compilation and freezing the type information. The only
- merit of my scheme (as with all interpreted ones) is that I can dynamically
- extend the range of 'instance variables'. e.g. if from time t3 I need to
- have a variable 'x' I just send it a setX:99 message. I don't need to
- recompile. You could recompile, but I'm not sure how to preserve existing
- instances (say compiled with 3 instance variables) into a world of 4
- instance variables. Any thoughts about this?
-
-
- ------
- Benedict Heal tel: (0908) 652695
- Faculty of Mathematics e-mail: j.g.b.heal@open.ac.uk
- The Open University
- Milton Keynes
- MK7 6AA U.K.
-