gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ISO FORWARD is now implemented


From: Fischlin Andreas
Subject: Re: ISO FORWARD is now implemented
Date: Sat, 7 Dec 2024 14:22:31 +0000

Hi Gaius,

I doubt this is correct, as PIM does (unofficially for sure as of PIM3) also know about FORWARD. E.g. in Wirth et al., 1992 (attached) we wrote

Procedures referenced before declaration must be declared in advance by a FORWARD
declaration. The format is

PROCEDURE P(parameter list); FORWARD;

The corresponding procedure must have the full header repeated and must lie at the same
nesting level as the FORWARD declaration.

And in EBNF this means

ProcedureDeclaration = ProcedureHeading ";"
(block ident | FORWARD | CODE digit {hexDigit}"H").

As all 1-pass Modula-2 compilers coming from N. Wirth tolerated above extension of the language, I would suggest to leave it in for all PIM variants (e.g. Wirth, 1985a,b; Wirth, 1987; Wirth et al., 1992). This may also matter for recursive use of procedures, which is not only a 1-pass compiler issue, but may matter quite importantly for code making use of recursive procedure calls.

Regards,
Andreas

Cited References:
------------------------

Wirth, N., 1985a. A single-pass Modula-2 compiler for Lilith. Institut für Informatik, ETH, Zürich: 3.    Wi269


Wirth, N., 1985b. A fast and compact compiler for Modula-2. Institut für Informatik, ETH, Zürich. Internal Report 64, 1-22.    Wi261


Wirth, N., 1987. From Modula to Oberon. Institut für Computersysteme ETHZ, Swiss Federal Institute of Technology, Zürich, Switzerland. Internal report 82, 3-10.  doi: 10.3929/ethz-a-005363226   Wi031


Wirth, N., Gutknecht, J., Heiz, W., Schär, H., Seiler, H., Vetterli, C. & Fischlin, A., 1992. MacMETH.  A fast Modula-2 language system for the Apple Macintosh.  User Manual.  4th, completely revised ed. Department of Computer Sciences (ETH), Zürich, Switzerland. User Manual , 116pp. https://www.sysecol2.ethz.ch/SimSoftware/RAMSES/Documents/MacMETH_Manual.pdf   Wi068



ETH Zurich
Prof. em. Dr. Andreas Fischlin
Formerly IPCC Vice-Chair WGII
Systems Ecology - Institute of Biogeochemistry and Pollutant Dynamics
CHN E 24
Universitaetstrasse 16
8092 Zurich
SWITZERLAND


+41 44 633-6090 phone
+41 79 595-4050 mobile

             Make it as simple as possible, but distrust it!
________________________________________________________________________

Attachment: Wi269.pdf
Description: Adobe PDF document

Attachment: Wi261.pdf
Description: Adobe PDF document

Attachment: Wi031.pdf
Description: Adobe PDF document

Attachment: Wi068.pdf
Description: Adobe PDF document














On 7 Dec 2024, at 12:51, Gaius Mulley <gaiusmod2@gmail.com> wrote:

john o goyo <jog37@riddermarkfarm.ca> writes:

Greetings, Gaius.

On 2024-12-06 10:26, Gaius Mulley wrote (in part):
On 2024-10-19 09:11, Gaius Mulley wrote (in part):
Hi,

I've git pushed a patchset which implements the ISO FORWARD keyword to
the development branch of GCC.  The patch also improves parameter and
return type checking.  Parameter mismatch errors should now result in
virtual token being highlighted (or multiple tokens for example the
parameter declaration).
Hi John,

just to mention that these improvements have been back ported to gcc-14,

Thank you, Gaius.  Is FORWARD also available in the PIM dialect?

Hi John,

I'm about to git push a patch to restrict FORWARD to ISO:

$ gm2 forward.mod
forward.mod:4:31: error: In procedure ‘foo’: forward declaration is only allowed in the ISO dialect of Modula-2
   4 | PROCEDURE foo (a: CARDINAL) ; FORWARD ;
     |                               ^~~~~~~

$ gm2 -fiso forward.mod
$

regards,
Gaius

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]