home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!elroy.jpl.nasa.gov!usc!sol.ctr.columbia.edu!destroyer!ubc-cs!alberta!kakwa.ucs.ualberta.ca!muskwa.ucs.ualberta.ca!dhalliwe
- From: userDHAL@mts.ucs.UAlberta.CA (David Halliwell)
- Subject: Re: Is this legal - why/why not?
- Message-ID: <dhalliwe.712524093@muskwa.ucs.ualberta.ca>
- Sender: news@kakwa.ucs.ualberta.ca
- Nntp-Posting-Host: muskwa.ucs.ualberta.ca
- Organization: University Of Alberta, Edmonton Canada
- 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> <1992Jul30.174037.6433@nntpd.lkg.dec.com>
- Date: Thu, 30 Jul 1992 19:21:33 GMT
- Lines: 43
-
- reagan@hiyall.enet.dec.com (John R. Reagan) writes:
-
-
- >In article <Bs6L75.BDK@knot.ccs.queensu.ca>, dmurdoch@QueensU.CA (Duncan Murdoch) writes...
- >>
- >>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.
-
- >Nope, I didn't make a typo. The Pascal standard doesn't discuss
- >"sequential" anything. The "INTEGER = 1..10" is a defining occurrance
- >of the identifier INTEGER for the entire region (the region goes backwards
- >to the beginning of the block). This definition of INTEGER retroactively
- >changes the previous use of INTEGER in the definition of FOO. You now
- >have a "use before declare" situation and thats illegal.
-
- Are you sure that standard Pascal doesn't discuss sequential
- anything? I always thought that the basic governing principle of
- Pascal was that *everything* in the language definition was sequential:
- you can't do anything unless you have already told the compiler about
- it. Of course, the compiler has predefined types, etc., but beyond
- those basics you have to declare or define everything. You can't refer
- to a variable, function, or procedure until the code that defines it
- has been compiled. If you *have* to (due to interdependencies), then
- you need to forward declare the procedure.
-
- To retroactively change the previous use would require multiple
- passes through the source code. And then we would be reduced to
- FORTRAN compile speeds ;-)
-
- Or am I suffering a memory parity error?
-
- >Of course, noone claims that Turbo Pascal is standards conforming...
-
- Amen to that.
-
-
- Dave Halliwell
- Department of Geography
- University of Alberta
- Edmonton, Alberta
-