🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #4858

Re^4: Error in PD Modula-2 compiler? Or just in my brain?

#4858
From: Martin Neitzel
Date: Fri, 02 Jun 1989 11:46
75 lines
3521 bytes
Legend:
MN>	Martin Neitzel <neitzel@infbs>
FvO>	fransvo@maestro.htsa.aha.nl (Frans van Otten)
PIM3>	N. Wirth, "Programming in Modula2", 3rd corrected edition

I wrote ealier:

MN>	4. It is a known ambiguity in the Modula2 report: Can standard
MN>	   identifiers be redefined or not?  In procedures, definitely
MN>	   yes, but the situation in modules is not clear at all.

FvO>	The situation is perfectly clear.

We agree in the case of procedures (where redefinitions are possible),
but have different opinions with respect to modules.  

FvO>	[Correctly explains the case for procedures, and gives a nice
FvO>	overview about matters with respect to the tutorial and
FvO>	reference part of PIM3.]

Warning: The following is nitpicking.  I know.  (However, when one has
to implement a language, one has has to be nitpicking.)

FvO>	chapter 4, "Declarations and scope rules", first alinea:

With my interpretation (allowing redefinitions):

PIM3>	" Every identifier occuring in a program must be introduced by a
PIM3>	declaration, unless it is a standard identifier.  The latter are
PIM3>	considered to be predeclared, ...

namely in the "standard environment"

PIM3>	... and they are all valid in all parts of a program. ...

Either you have provided your own declaration for the identifier, or
the declaration of the standard environment can be found.

PIM3>	... For this reason they are called pervasive. "

They can be found across module borders without explicit import,
that's certainly a "pervasive" property.

FvO>	This says it all.  Valid in ALL parts of the program,
FvO>	pervasive...  They always prevail, even when redeclared.

This says it all.  Valid in ALL parts of the program,...
A (pervasive) declaration can always be found, even when not
provided by the programmer.

Now, is my mind totally out to lunch?  I'm not saying that Frans or I
are plain wrong, but the way I see it, the situation is not clear.

FvO>	 So I decided for the compiler I'm developing:
FvO>	 " The standard identifiers can be considered to be declared
FvO>	    in every (local and global) module, prior to any import.
FvO>	    Between the standard identifiers and the rest of the
FvO>	    module (including the import part) is an imaginary
FvO>	    procedure border.  Importing may be considered the same as
FvO>	    declaring.  "

This is a clear definition.  (For you and me as implementors, there
still is the possibility that standard id's can be redeclared in
procedures and records, so we still have to be careful when we see
one.)  Life would be somewhat easier, if there was a clear cut between
standard id's and the rest (e.g., the keyword solution), especially
with respect to constant expressions.  PIM4 just changed them back to
the PIM2 version... gack!

I also would appreciate it, if it were made clear that IM- and
EXPORTed identifiers have to be viewed as declared.  Now THAT would
settle it (and match with Frans' interpretation and rule).  Perhaps in
PIM5?  :-(

							Martin
Technical Details
Message-ID: <1234@infbs.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!unido!infbs!neitzel
References: <340@actisb.UUCP> <1090@gmdzi.UUCP> <1231@infbs.UUCP> <944@maestro.htsa.aha.nl>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!unido!infbs!neitzel
From: neitzel@infbs.UUCP (Martin Neitzel)
Newsgroups: comp.lang.modula2
Subject: Re^4: Error in PD Modula-2 compiler? Or just in my brain?
Message-ID: <1234@infbs.UUCP>
Date: 2 Jun 89 11:46:37 GMT
References: <340@actisb.UUCP> <1090@gmdzi.UUCP> <1231@infbs.UUCP> <944@maestro.htsa.aha.nl>
Organization: TU Braunschweig,Informatik,West Germany
Lines: 75