home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / pascal / 4622 < prev    next >
Encoding:
Text File  |  1992-07-30  |  1.6 KB  |  37 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!sun-barr!decwrl!deccrl!news.crl.dec.com!news!nntpd.lkg.dec.com!hiyall.enet.dec.com!reagan
  3. From: reagan@hiyall.enet.dec.com (John R. Reagan)
  4. Subject: Re: Is this legal - why/why not?
  5. Message-ID: <1992Jul30.174037.6433@nntpd.lkg.dec.com>
  6. Sender: usenet@nntpd.lkg.dec.com (USENET News System)
  7. Organization: Digital Equipment Corporation
  8. References: <l7b682INNasf@muleshoe.cs.utexas.edu> <1992Jul29.072408.23090@monu6.cc.monash.edu.au> <1992Jul29.201359.4297@nntpd.lkg.dec.com> <Bs6L75.BDK@knot.ccs.queensu.ca>
  9. Date: Thu, 30 Jul 1992 18:36:43 GMT
  10. Lines: 25
  11.  
  12.  
  13. In article <Bs6L75.BDK@knot.ccs.queensu.ca>, dmurdoch@QueensU.CA (Duncan Murdoch) writes...
  14. >Is that really illegal, or did you make a typo?  It compiles just as
  15. >you'd expect in Turbo Pascal:  "foo" becomes the standard 16 bit integer
  16. >type, "integer" becomes the subrange 1..10.  TP processes the declarations
  17. >strictly sequentially; I had thought standard Pascal did it that way
  18. >too.
  19.  
  20. Nope, I didn't make a typo.  The Pascal standard doesn't discuss
  21. "sequential" anything.  The "INTEGER = 1..10" is a defining occurrance
  22. of the identifier INTEGER for the entire region (the region goes backwards
  23. to the beginning of the block).  This definition of INTEGER retroactively
  24. changes the previous use of INTEGER in the definition of FOO.  You now
  25. have a "use before declare" situation and thats illegal.
  26.  
  27. Of course, noone claims that Turbo Pascal is standards conforming...
  28.  
  29. ---
  30. John Reagan
  31. Digital Equipment Corporation
  32. reagan@hiyall.enet.dec.com
  33. Disclaimer:  The opinions and statements expressed by me are not
  34.              necessarily those of Digital Equipment Corporation.
  35. ---
  36.