the PROGRAM line

WB Kloke wb@pkeus.de
Wed Mar 26 15:34:11 GMT 2025


In case of the PROGRAM bold tag the solution may be easy. Either make
it optional or add a compilation flag to choose the style.

> Note however that there is another way GNU Algol 68 diverges from the
> Report: the enclosed clause conforming the particular-program yields an
> integer rather than VOID, which is the exit status reported to the OS
> upon program termination.  Ideas on how to best avoid this divergence
> are welcome.

To make the situation worse. Unix (or POSIX) is not all. Plan 9 programs
don't return an integer, but a string as error indication.
Therefore, main is defined as

void main(int argc, char *argv[])

and the error string is returned via exits(err) .
This, and possible other differences in OS, may be best handled in a
particular-postlude, which may be added using a compiler command line switch.

Newer plan9 programs use the threaded variant

void threadmain(int argc, char **argv)

Wether the syntax of RR10.1.1d (user-task-list) is helpful for
threaded programs, is not clear, as the threads are normally created
after the examination of the command line.

The historic implementations of Algol68 did not support parallel-clauses
AFAIK.  

Perhaps the handling of command line arguments should be considered
as part of a particular-prelude instead the particular-program.
In this respect Algol68 has an advantage over solutions derived from C,
as the particular-program is not restricted to a C single level function.

OTOH, given the strong vitality of the C programming model, RR10.1.1
may be ignored altogether as pure history, and be replaced by a 
adjourned model.


More information about the Algol68 mailing list