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

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!cs.utexas.edu!torn!news.ccs.queensu.ca!dmurdoch
  3. From: dmurdoch@QueensU.CA (Duncan Murdoch)
  4. Subject: Re: Is this legal - why/why not?
  5. Message-ID: <Bs6L75.BDK@knot.ccs.queensu.ca>
  6. Sender: news@knot.ccs.queensu.ca (Netnews control)
  7. Organization: Queen's University, Kingston, Canada
  8. References: <l7b682INNasf@muleshoe.cs.utexas.edu> <1992Jul29.072408.23090@monu6.cc.monash.edu.au> <1992Jul29.201359.4297@nntpd.lkg.dec.com>
  9. Date: Thu, 30 Jul 1992 02:49:53 GMT
  10. Lines: 18
  11.  
  12. In article <1992Jul29.201359.4297@nntpd.lkg.dec.com> reagan@hiyall.enet.dec.com (John R. Reagan) writes:
  13. >type foo = integer;
  14. >     integer = 1..10;
  15. >
  16. >is illegal since integer was used for 2 things in the same scope.
  17.  
  18. Is that really illegal, or did you make a typo?  It compiles just as
  19. you'd expect in Turbo Pascal:  "foo" becomes the standard 16 bit integer
  20. type, "integer" becomes the subrange 1..10.  TP processes the declarations
  21. strictly sequentially; I had thought standard Pascal did it that way
  22. too.
  23.  
  24. Of course, if you meant "foo = (integer)" in the first line,
  25. that's different:  it's defining "integer" to be a constant, and you can't
  26. then define "integer" to be a type as well.
  27.  
  28. Duncan Murdoch
  29. dmurdoch@mast.queensu.ca
  30.