J. David Bryan wrote:
Nearly. ;-) I believe item "g" actually refers to this case:
for i := 1 to 10 do for i := 11 to 20 do ;
The second for-statement is contained in the first and threatens the first for-statement's control variable, and so is illegal by item "g".
Alright, this makes sense.
Yes, but is a goto into a loop legal at all (the last sentence of 6.9.2.4 seems to indicate not to me, but I'm not completely sure)?
[...]
(c) S is a statement of the statement-sequence of the compound-statement of the statement-part of a block containing G."
Wow, 4 "of"s in a row! ;-)
Item "b" appears to be the key, as the question fails items "a" and "c". Going out of a for-statement is legal:
for i := 1 to 10 do goto 1; 1: ;
...because the for-statement (part of the statement-sequence containing G) and the null-statement (S) are both part of the same statement-sequence. However, going into a for-statement is not legal:
goto 1; for i := 1 to 10 do 1: ;
...because the null-statement (S) is not part of the statement-sequence containing the goto-statement (the statement-sequence containing the goto- statement consists of the goto-statement and the for-statement but *not* the null-statement).
It took me three days of head-scratching to decide this, so I hope I am correct (this time)!
I hope so, too -- it does make sense, after all...
Frank
On 24 May 2000, at 12:56, Frank Heckenbach wrote:
(c) S is a statement of the statement-sequence of the compound-statement of the statement-part of a block containing G."
Wow, 4 "of"s in a row! ;-)
I am a native speaker of English, but often I cannot make any sense out of the shortest of sentences in the EP standard. I think it was written by a committee from Mars. ;-)
-- Dave
On 24 May 2000, at 23:49, J. David Bryan wrote:
On 24 May 2000, at 12:56, Frank Heckenbach wrote:
(c) S is a statement of the statement-sequence of the compound-statement of the statement-part of a block containing G."
Wow, 4 "of"s in a row! ;-)
I am a native speaker of English, but often I cannot make any sense out of the shortest of sentences in the EP standard. I think it was written by a committee from Mars. ;-)
That's being unkind to the Martians ;-). The statement is utter trash, and I can honestly say that I have never read anything more appalling in my whole life. IHMO it must have been written by someone who was either stoned out of his mind, totally plastered, absolutely demented, or just plain daft. Whatever the case, such an individidual should not be allowed anywhere near a language that is famed for its clarity and readability. Who are these guys anyway?
Best regards, The Chief ----- Dr Abimbola A Olowofoyeku (The African Chief) Email: African_Chief@bigfoot.com Author of Chief's Installer Pro v5.22 for Win32 http://www.bigfoot.com/~African_Chief/chief32.htm
On Wed, 24 May 2000 23:49:29 -0400, you said:
JDB> On 24 May 2000, at 12:56, Frank Heckenbach wrote:
(c) S is a statement of the statement-sequence of the compound-statement of the statement-part of a block containing G."
Wow, 4 "of"s in a row! ;-)
JDB> I am a native speaker of English, but often I cannot make any sense out of JDB> the shortest of sentences in the EP standard. I think it was written by a JDB> committee from Mars. ;-)
A standard specification is not a novel, a nespaper article or even a programmer's manual. Any standard is difficult to read, but standards for programming languages are by far the most complicated ones.
Different specification methods have been attempted by different standardization committees, but none of them is easy to read and to understand. The problem is that you can never leave any ambiguity, never assume that any normal reader will understand without further details. In some standard documents, formal specification methods have been used, and anybody thinking that the Pascal or Extended Pascal standards are difficult should consider the standards for Algol 68, Ada or Modula-2.
The main problem is that Extended Pascal probably lacks a good programmer's manual. In any case, the standard specification should be read only by implementors, not by users.
Olivier Lecarme
On 26 May 2000, at 11:26, Olivier Lecarme wrote:
In some standard documents, formal specification methods have been used, and anybody thinking that the Pascal or Extended Pascal standards are difficult should consider the standards for Algol 68, Ada or Modula-2.
The Ada 95 standard, a.k.a., the Language Reference Manual, is a model of clarity compared to the EP standard (I have read both). For example, in answering the question as to whether it is legal to transfer into a loop, the Ada 95 LRM says:
"The innermost sequence_of_statements that encloses the target statement shall also enclose the goto_statement."
and then further clarifies this statement with this note:
"The above rules allow transfer of control to a statement of an enclosing sequence_of_statements but not the reverse."
In my opinion, that is substantially clearer than the EP rules cited earlier.
-- Dave