Re: Language arcana [was PL/I arcana]

"robin" <robin51@dodo.com.au>
Wed, 19 Jan 2011 08:13:29 +1100

          From comp.compilers

Related articles
Re: language design implications for variant records in a pascal-like compilers@is-not-my.name (2011-01-16)
Re: PL/I arcana, was language design implications for variant records compilers@is-not-my.name (2011-01-17)
Re: Language arcana [was PL/I arcana] robin51@dodo.com.au (robin) (2011-01-19)
| List of all articles for this month |

From: "robin" <robin51@dodo.com.au>
Newsgroups: comp.compilers
Date: Wed, 19 Jan 2011 08:13:29 +1100
Organization: Compilers Central
References: 11-01-063 11-01-073
Keywords: Fortran, history
Posted-Date: 18 Jan 2011 23:35:44 EST

From: <compilers@is-not-my.name>
Sent: Tuesday, 18 January 2011 9:51 AM


>> > [IF THEN = ELSE THEN IF = ELSE; ELSE IF = THEN; -John]
>>
>> Ha! When I get a chance I may try compiling that under PL/I...!
>
> Ok. Here it is. If I had not compiled it myself I would not have believed
> it!
> 1 LOGIC: PROC OPTIONS(MAIN);
> 2 DCL (IF, THEN, ELSE) CHAR;
> 3 BEGIN;
> 4 IF THEN = ELSE THEN IF = ELSE; ELSE IF = THEN;
> 6 END;
> 7 END;


In Fortran, a similar successful compilation can be obtained for :--


IF (THEN == ELSE) THEN; IF = ELSE; ELSE; IF = THEN; END IF


In Algol, a similar constaruct is possible, but typically
reserved words are enclosed in apostrophes, so it's not quite so dramatic.
[I stopped writing Fortran compilers with F77. Let me tell you, it
was a pain in the patoot to tell a FORMAT statement from a statement
function FORMAT(A3,I2) = A3**I2
(Yes, I know how to do it. I did it, after all.) -John]



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.