Below is a sampling of some notable extensions: • Automatic
op:= for any operator, e.g. *:= and +:= • UPTO, DOWNTO and UNTIL in loop-clauses; • displacement operator (:=:=) • ANDF, ORF and THEF
syntactic elements. • separate compilation - ENVIRON clause and USING clause • scopes not checked • bounds in formal-declarers • CODE ... EDOC clause - for embedding ZCODE
The ENVIRON and USING clauses Separate compilation in ALGOL 68C is done using the ENVIRON and USING clauses. The ENVIRON saves the complete environment at the point it appears. A separate module written starting with a USING clause is effectively inserted into the first module at the point the ENVIRON clause appears. ENVIRON and USING are useful for a
top-down style of programming, in contrast to the
bottom-up style implied by traditional library mechanisms. 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. 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==