Content deleted Content added
m →Compiler directives: moving... |
|||
Line 55:
There were numerous special handlers and variables that were used during I/O. For instance, the {{code|INCHWL}} function was an INPUT hard-wired to the user terminal and always open, and it returns its break character in the system variable {{code|!SKIP!}}.{{sfn|Smith|1976|p=30}} The {{code|PRINT}} function normally output to the same terminal channel, but could also be directed at any other opened channel.{{sfn|Smith|1976|pp=2, 38}}
===Compiler directives===
As a systems programming language, performance was important and to help with this, SAIL included a {{code|DEFINE}} which used string-replacement in a fashion similar to C's {{code|#define}} macros.{{sfn|Smith|1976|p=25}} A difference was that the delimiters around the substitution had to be defined, for instance {{code|REQUIRE "[][]" DELIMITERS;DEFINE maxSize{{=}}[100];}}. One common use of these macros was to define character constants like {{code|CRLF}}, as these were not part of the basic language.{{sfn|Smith|1976|p=25}} Another was to redefine the {{code|COMMENT}} statement to the shorter {{code|!}}.{{sfn|Smith|1976|p=26}}
The system also included a [[conditional compilation]] system using statements, as opposed to pre-processor directives as found in C. {{code|IFCR}} would compile the blocks between the corresponding {{code|THENC}} and {{code|ELSEC}} or {{code|ENDC}}. The condition in the IFCR must be known at compile time, so, like C, was normally a {{code|DEFINE}}d value.{{sfn|Smith|1976|p=44}}
==Example==
|