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