Content deleted Content added
Line 29:
{{code|DONE}} exited from a block, typically used in loops, and {{code|CONTINUE}} returned to the top of the block. An infinite loop was typically implemented with {{code|WHILE TRUE DO...}}.{{sfn|Smith|1976|p=18}}
===Procedure declarations===
Procedures were implemented in a fashion similar to the [[C programming language]], with the return type, if any, in front of the name, for instance, {{code|STRING PROCEDURE toUpper(STRING originalStr);BEGIN...}}. Note the uncommon use of the semicolon here, whereas PASCAL would immediately follow with a block, typically a {{code|BEGIN}}. In order to improve performance, SAIL added two qualifiers, {{code|SIMPLE}} and {{code|RECURSIVE}}. If a procedure did not specifically say {{code|RECURSIVE}}, when the procedure was called it would not create an [[activation record]], thereby improving performance. SAIL also included the {{code|FORWARD}} qualifier, used to insert [[forward declaration]]s, typically when two procedures call each other.{{sfn|Smith|1976|p=21}} {{code|RETURN}} worked as in C, both exiting the procedure and returning to the caller, as well as returning a value if the procedure uses one.{{sfn|Smith|1976|p=23}} Parameters passed to the procedures could be by {{code|VALUE}} or {{code|REFERENCE}}, the later allowing values to be passed back.{{sfn|Smith|1976|p=24}}▼
Procedures were implemented in a fashion similar to the [[C programming language]], with the return type, if any, in front of the name, for instance, {{code|STRING PROCEDURE toUpper(STRING originalStr);BEGIN...}}. Note the uncommon use of the semicolon here, whereas PASCAL would immediately follow with a block, typically a {{code|BEGIN}}.{{sfn|Smith|1976|p=21}}
In order to improve performance, SAIL added two procedure qualifiers, {{code|SIMPLE}} and {{code|RECURSIVE}}. {{code|RECURSIVE}} told the compiler that the procedure might call itself, and thus its [[local variable]]s had to be written to the stack, not just return information. {{code|SIMPLE}} did the opposite, telling the compiler that the local variables did not have to be saved, but additionally forced the procedure to have no local variables at all, did not allow {{code|GOTO}} out of the function, and could not refer to enclosing procedure's variables. These directives could avoid the requirement of filling out a complete [activation record]], thereby improving performance.{{sfn|Smith|1976|p=22}}
▲
===Data types and operators===
|