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

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!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: <1992Jul29.201359.4297@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>
  9. Date: Wed, 29 Jul 1992 21:09:55 GMT
  10. Lines: 46
  11.  
  12.  
  13. In article <1992Jul29.072408.23090@monu6.cc.monash.edu.au>, ins894r@aurora.cc.monash.edu.au (Aaron Wigley [Wigs]) writes...
  14. >sirosh@cs.utexas.edu (Joseph Sirosh) writes:
  15. >: I have two questions.
  16. >: 
  17. >: 1. The following declaration for an enumerated type is legal.
  18. >:     Type Used = (Integer, Char, Boolean);
  19. >: 
  20. >: even though Integer, Char, Boolean etc. are names of predefined types.
  21. >: This works on Think Pascal on the Mac.
  22. 1)
  23.  
  24. type used = (integer,char,boolean);
  25.  
  26. is legal
  27.  
  28. 2)
  29.  
  30. type used = (integer)
  31.  
  32. is legal
  33.  
  34. 3) 
  35.  
  36. type bigone = array [integer] of integer;
  37.  
  38. is legal.
  39.  
  40. There must be bugs in the compilers you use.  There is nothing
  41. wrong with redefining predeclared identifiers.  They aren't special
  42. in this regard.  You just can't use the same identifier for two
  43. things in the same scope.  For example,
  44.  
  45. type foo = integer;
  46.      integer = 1..10;
  47.  
  48. is illegal since integer was used for 2 things in the same scope.
  49.  
  50. ---
  51. John Reagan
  52. Digital Equipment Corporation
  53. reagan@hiyall.enet.dec.com
  54. Disclaimer:  The opinions and statements expressed by me are not
  55.              necessarily those of Digital Equipment Corporation.
  56. ---
  57.