home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / modula2 / 1556 < prev    next >
Encoding:
Text File  |  1992-12-13  |  1.4 KB  |  39 lines

  1. Newsgroups: comp.lang.modula2
  2. Path: sparky!uunet!munnari.oz.au!sol.deakin.OZ.AU!news.cs.uow.edu.au!seagoon.newcastle.edu.au!wombat.newcastle.edu.au!eepjm
  3. From: eepjm@wombat.newcastle.edu.au (Peter Moylan)
  4. Subject: Re: Generic stack implementation
  5. Message-ID: <1992Dec14.133750.1@wombat.newcastle.edu.au>
  6. Lines: 27
  7. Sender: news@seagoon.newcastle.edu.au
  8. Organization: University of Newcastle, AUSTRALIA
  9. References: <9212091316.AA14856@elg> <911288c.32.724187845@ace.acadiau.ca>
  10. Date: Mon, 14 Dec 1992 02:37:50 GMT
  11.  
  12. In article <911288c.32.724187845@ace.acadiau.ca>, 911288c@ace.acadiau.ca (HON (EDWIN) KIN CHUNG) writes:
  13.  
  14. >>VAR
  15. >>   [...]
  16. >>   location: ADDRESS;
  17. >>BEGIN
  18. >>   [...]
  19. >>         INC(location, TSIZE(WORD));
  20. >         ^^^^^^
  21. >         parameter not correct type ??
  22. >     Is this some problem ...???
  23. >     I am using TopSpeed Modular-2.
  24.  
  25. TopSpeed Modula-2 won't let you do arithmetic on addresses.  And a
  26. good thing, too, in my opinion.  Address arithmetic is one of the
  27. most non-portable things you can do, and I'm a little shocked to
  28. see an example of it in a textbook.
  29.  
  30. There's a procedure in one of the TopSpeed libraries called AddAddr
  31. or something similar (sorry I can't be more explicit, my TopSpeed
  32. manuals are at home) which will be an adequate substitute for the
  33. INC in this example.  A better solution, though, would be to 
  34. redesign the algorithm so that it didn't need to do address arithmetic.
  35.  
  36. -- 
  37. Peter Moylan                      eepjm@wombat.newcastle.edu.au
  38.