Category:ALGOL 68: Difference between revisions
m
→Example of different program representations: Added Upper stropping
m (→Resources: * '''NEW:''' [[http://www.softwarepreservation.org/projects/ALGOL/book/Lindsey_van_der_Meulen-IItA68-Revised.pdf softwarepreservation.org has an on-line PDF]) |
m (→Example of different program representations: Added Upper stropping) |
||
Line 94:
ALGOL 68 should be able to run on machines with only uppercase. Hence
the official spec provided for different representations of the same
program. Upper stropping (representing the bold words by upper case and
program. Example:▼
non-bold words in lower case) was introduced by Algol 68R. Upper stropping
is used by Algol 68RS and is one of the options for Algol 68G. Most of the samples
on Rosetta Code use Upper stropping.
{|border="1" style="border-collapse: collapse; border: 5px double grey;" align="center"
|| Algol68 as typically published
Line 114 ⟶ 118:
sum sq+:=i↑2
'od'
||
.PR UPPER .PR
MODE XINT = INT;
Line 123 ⟶ 127:
sum sq+:=i**2
OD
||
.PR POINT .PR
.MODE .XINT = .INT;
Line 132 ⟶ 136:
SUM SQ .PLUSAB I .UP 2
.OD
||
.PR RES .PR
mode .xint = int;
Line 141 ⟶ 145:
sum sq+:=i↑2
od
|| Upper stropping
# upper case = bold #
MODE XINT = INT;
XINT sum sq:=0;
FOR i WHILE
sum sq /= 70*70
DO
sum sq PLUSAB i UP 2
OD
|}
|