Anonymous user
ALGOL 68RS: Difference between revisions
m
copy edit - wiki link to wikipedia
m (LinkALGOL 68R) |
m (copy edit - wiki link to wikipedia) |
||
Line 1:
{{wikipedia}}{{implementation|ALGOL 68}}
ALGOL 68RS from [
The language was based on the Revised Report, but with similar subset restrictions to [[ALGOL 68R]].
Line 9:
Syntax:
<lang algol68>PROGRAM [ (holelist ) ] progtitle▼
▲PROGRAM [ (holelist ) ] progtitle
[ CONTEXT holename IN progtitle ]
[ USE uselist ]
enclosed clause
FINISH</lang>
<lang algol68>DECS dectitle▼
▲DECS dectitle
CONTEXT holename IN progtitle
[ USE uselist ]
decsbody
KEEP keeplist
FINISH</lang>
=== Example ===
<lang algol68>PROGRAM (thinking, displaying) chess▼
▲PROGRAM (thinking, displaying) chess
BEGIN
MODE PIECE = STRUCT(...);
Line 36 ⟶ 30:
HERE displaying(PIECE, pieces, BOARD, game);
...
END</lang>
<lang algol68>PROGRAM thinkmodule▼
▲PROGRAM thinkmodule
CONTEXT thinking IN chess
...
FINISH</lang>
An entire program can thus be '''composed''' of pieces of other modules, particularly if a ''hole'' contains a sub-''hole'' (eg displaypiece), then this ''hole'' can in-turn be pulled into the composition.
Example:
<lang algol68>PROGRAM abc▼
▲PROGRAM abc
COMPOSE game(thinking=thinkmodule, displaying=displayingmodule(piece=displaypiece))
FINISH</lang>
|