“It’s ALGOL!”
Boring or not, ALGOL is Simula, and you cannot learn one without learning the other. Let’s start with the traditional “Hello, world!” chant to illustrate using comments and compound statements.
| | % A comment |
| | ! Another comment ; |
| | BEGIN |
| | OutText("Hello World!"); |
| | COMMENT One more comment ; OutImage; |
| | END of Program |
An unterminated comment begins with % and extends to the end of the line. Terminated comments begin with ! or COMMENT and extend to the first semicolon because both are statements, and statements must always conclude with a semicolon. Everything after the END clause to the end of the line is ignored too.
A compound statement is a sequence of single or other compound statements wrapped ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access