[J3] Syntax of conditional expressions

Robert Corbett rpcorbett at att.net
Tue Jun 29 23:17:28 UTC 2021

In Algol 68, like Algol 60, the
tokens usually considered to
be keywords are in a separate
space from identifiers.  The
Report did not spell out a
specific lexical syntax.
Differences in “syntactic sugar”
made no difference to the
language.  There was a
reference syntax, but it
involved characters (such as
the sub10 character) that were
rarely available on existing
computers.  Programs written
for one compiler typically
required translation before
they could be compiled using
another compiler.


REF REAL real;
‘ref’’real’ real;
‘ref ‘real real;

were used by different Algol 68
compilers and they all meant the
same thing.

The reason the parentheses
are needed is to support
fixed-form source.  In
free form, the extra
parentheses are unnecessary.

Bob Corbett

> On Jun 29, 2021, at 3:28 PM, Van Snyder via J3 <j3 at mailman.j3-fortran.org> wrote:
>> On Tue, 2021-06-29 at 12:08 -0700, Gary Klimowicz via J3 wrote:
>> The verbose form in Algol-68 was much more concise to begin with:
>>     if a then b elif c then d else e fi      # 35 chars #
>> Compare to (21-157r1 line 28)
>>     if (a) then (b) elseif (c) then (d) else (e) endif ! 50 chars, 43% more
> Didn't Algol 68 have reserved words? I think Malcolm's argument was that the extra punctuation is necessary to avoid syntax ambiguities.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20210629/26aac7c7/attachment.htm>

More information about the J3 mailing list