Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
SAIL (programming language)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===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...|pascal}}. 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 the subroutine return information. {{code|SIMPLE}} did the opposite, demanding the procedure have no local variables at all, not allowing {{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}} This also had the side-effect of meaning that variables declared within a procedure that was not marked {{code|RECURSIVE}} would not be reset between calls,{{sfn|Smith|1976|p=22}} acting similar to C's {{code|static}}. 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, exiting the procedure and returning to the caller, as well as optionally 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}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)