ALGOL 60 is a block-structured programming language specified through a formal report, with nested declarations, procedures, typed variables and structured statements for numerical algorithms. An identifier's meaning depends on its enclosing blocks, making lexical scope explicit. The revised report also uses a precise grammar to distinguish syntactic structure from the typography of a particular printed program.[ref]
Revised Report on the Algorithmic Language ALGOL 60 edited by Peter Naur. blocks, declarations and procedure statements
Its parameter mechanisms include call-by-value and call-by-name. The latter behaves through systematic replacement, with renaming to avoid accidental identifier capture, rather than simply copying one already evaluated value. A procedure that refers to a name parameter more than once can therefore evaluate its actual expression more than once. This matters when the expression depends on changing variables or has effects; the two calling conventions are not interchangeable.
Call-by-name passes a procedure argument so that each use of the formal parameter refers to the actual expression in its calling environment. In ALGOL 60, the report explains this through replacement with renaming to avoid accidental capture of identifiers. An expression can consequently be evaluated more than once.[ref]
Revised Report on the Algorithmic Language ALGOL 60 edited by Peter Naur. §4.7.3.2, Name replacement
Suppose the actual argument is
a[i]. The procedure reads its name parameter, changes i, and reads the parameter again. With call-by-name, the second access can select a different array entry. With call-by-value, both accesses use the value obtained before entering the procedure. This is also different from saving the original entry's address. Call-by-name does not imply lazy evaluation with memoization: repeated evaluation can repeat both work and side effects. Articles by others on the same topic
There are currently no matching articles.