home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / programm / 18517 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.7 KB

  1. Path: sparky!uunet!mcsun!sunic!lunic!my!sm-emac15.sm.luth.se!matti
  2. From: matti@my.sm.luth.se (Matti Larborn)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Think Pascal - Whats... - data abstraction?
  5. Message-ID: <1351@my.sm.luth.se>
  6. Date: 17 Nov 92 14:01:15 GMT
  7. References: <6746@m1.cs.man.ac.uk>
  8. Sender: news@sm.luth.se
  9. Organization: Lule} University
  10. Lines: 36
  11. X-UserAgent: Nuntius v1.1.1d11
  12. X-XXMessage-ID: <A72EB9B97F01037B@sm-emac15.sm.luth.se>
  13. X-XXDate: Tue, 17 Nov 92 14:01:13 GMT
  14.  
  15. In article <6746@m1.cs.man.ac.uk> Julian Fletcher,  writes:
  16. >Think pascal seems to have fallen by the wayside in comparison with
  17. think C.
  18. >
  19. >1    Are there any further upgrades since 4.0.1 ?
  20. >    If so, where can they be obtained from, and what are the improvements ?
  21. >
  22. >2    Does anybody have any idea of the future of this wonderful product
  23. >    i.e. is Symantec really committed to it ?
  24.  
  25. Another question: Why don't Think Pascal support abstract datatypes?
  26.  
  27. The only thing they would have to add is an export declaration:
  28.  
  29.     x=object
  30.         export a,b; { or name it public if you like }
  31.         a: integer;
  32.         b: real;
  33.         c: char; { hidden }
  34.  
  35.         {?operations }
  36.     end;
  37.  
  38.  
  39. There are also better ways to do this, but if you cannot hide fields in
  40. objects you cannot make abstract datatypes. One main idea with objects is
  41. to hide the data in the object so that the user cannot manipulate it
  42. unless he/she uses the supplied operations. In this way you get code that
  43. is easier to modify (since other parts of the program doesn't know
  44. anything about your implementation) and you also get secure programs. If
  45. one uses the built in operations one cannot do anything wrong (unless the
  46. operations have some errors in them).
  47.  
  48. Symantec: Please add some kind of export feature to Think Pascal...
  49.  
  50.     --Matti Larborn, Sweden
  51.