As far as I know, this was simply an oversight, since it was Wirth himself that requested this to be changed, when the standard was being formulated.
Also AFAIK, this particular problem was first highlighted by Lecarme and Desjardins, in their paper "More comments on the programming language Pascal", "Acta Informatica", 4, 231-243, 1975 (quoted by J. Welsh, W.J. Sneering, and C.A.R. Hoare, in their 1977 paper "Ambiguities and insecurities in Pascal", "Software Practice and Experience", reprinted in "Pascal - The Language and its Implementation", Barron, 1981).
Joe.
-----Original Message----- From: Frank Heckenbach [SMTP:frank@g-n-u.de] Sent: Tuesday, October 23, 2001 1:42 PM To: gpc@gnu.de Subject: Re: Errors and Standards (was: compiler bug)
da Silva, Joe wrote:
Oops! I'm sorry, the example I gave wasn't quite right! :-(
Below is a corrected example, which I hope is both correct (per J&W) and illustrates why this insecurity was changed when Pascal was standardized :
program test; .... procedure fred (function smith : integer); var dummy : integer; begin {fred} dummy := smith('A') end; {fred} .... function one (x : boolean) : integer; .... function two (x, y : integer) : integer; .... begin {test} .... fred(one); .... fred(two); .... end. {test}
As you can see, when the procedure "fred" is compiled, the compiler does not know how many parameters "smith" has, nor what type they are. This makes it difficult for the compiler to validate the program, and just imagine what will happen to the stack - yuck! <g>
Oh dear, then it's really as bad as I'd feared. So I think we won't introduce `--wirth-pascal' in GPC anytime soon. ;-)
Does anyone know why this was so? Wirth must certainly have noticed the problem. Was he just afraid of the nested parentheses in a SP-like declaration with parameters?
Frank
-- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/ GPC To-Do list, latest features, fixed bugs: http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html