Cambridge ALGOL 68C: Difference between revisions

From Rosetta Code
Content added Content deleted
No edit summary
m (→‎External links: New link)
 
Line 40: Line 40:
* [http://hopl.murdoch.edu.au/showlanguage.prx?exp=667 Cambridge Algol 68: on the historical roster of computer languages] - includes 10+ publication references.
* [http://hopl.murdoch.edu.au/showlanguage.prx?exp=667 Cambridge Algol 68: on the historical roster of computer languages] - includes 10+ publication references.
* [http://portal.acm.org/ft_gateway.cfm?id=807148&type=pdf A TRANSPORTATION OF ALGOL68C - PJ Gardner, University of Essex] - March 1977 (From 370 to DECsystem-10)
* [http://portal.acm.org/ft_gateway.cfm?id=807148&type=pdf A TRANSPORTATION OF ALGOL68C - PJ Gardner, University of Essex] - March 1977 (From 370 to DECsystem-10)
* [https://jmvdveer.home.xs4all.nl/en.post.algol-68-mvs.html Running Algol68C on MVS] - using an emulator

Latest revision as of 10:52, 30 January 2022

Cambridge ALGOL 68C is an implementation of ALGOL 68. Other implementations of ALGOL 68.

The ENVIRON and USING clauses.

These clauses are kind of the inverse of the #include found in the C programming language, or import found in Python. The purpose of the ENVIRON mechanism is to allow a program source to be broken into manageable sized pieces. Note that it is only necessary to parse the shared source file once, unlike a #include found in the C programming language where the include file needs to be parsed for each source file that includes it.

Example of ENVIRON clause

A file called mylib.a68:

BEGIN
   INT dim = 3; # a constant #
   INT a number := 120; # a variable #
   ENVIRON EXAMPLE1;
   MODE MATRIX = [dim, dim]REAL; # a type definition #
   MATRIX m1;
   a number := ENVIRON EXAMPLE2;
   print((a number))
END

Example of USING clause

A file called usemylib.a68:

USING EXAMPLE2 FROM mylib
BEGIN
  MATRIX m2; # example only #
  print((a number)); # declared in mylib.a68 #
  print((2 UPB m1)); # also declared in mylib.a68 #
  ENVIRON EXAMPLE3;  # ENVIRONs can be nested #
  666
END

Restrictions to the language from the standard ALGOL 68

  • no algol68 FLEX and variable length arrays.
  • MODE STRING implemented without FLEX.
  • The PAR parallel clause was not implemented.
  • nonstandard transput.
  • others...

A translator/compiler for ALGOL 68C was available for the PDP-10 and System/360 as well as a number of other computers.

External links