Cambridge ALGOL 68C: Difference between revisions
Content added Content deleted
m (foundation page, from wikipedia) |
m (Hardly a stub.) |
||
Line 1: | Line 1: | ||
{{implementation|ALGOL 68 |
{{implementation|ALGOL 68}} |
||
===The <code>ENVIRON</code> and <code>USING</code> clauses.=== |
===The <code>ENVIRON</code> and <code>USING</code> clauses.=== |
||
These clauses are kind of the ''inverse'' of the '''#include''' found in the C (programming language)|C programming language, or '''import''' found in Python (programming language)|Python. |
These clauses are kind of the ''inverse'' of the '''#include''' found in the C (programming language)|C programming language, or '''import''' found in Python (programming language)|Python. The purpose of the <code>ENVIRON</code> 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)|C programming language where the include file needs to be parsed for each source file that includes it. |
||
==== Example of <code>ENVIRON</code> clause ==== |
==== Example of <code>ENVIRON</code> clause ==== |
||
A file called ''mylib.a68'': |
A file called ''mylib.a68'': |
Revision as of 01:38, 15 January 2008
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)|C programming language, or import found in Python (programming language)|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)|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
- Cambridge Algol 68: on the historical roster of computer languages - includes 10+ publication references.
- A TRANSPORTATION OF ALGOL68C - PJ Gardner, University of Essex - March 1977 (From 370 to DECsystem-10)