Morrison's thesis explains how the design principles were applied in S-algol.
Data types The basic or
primitive data types in S-algol are integer, real, boolean, file, and string. (Later
pixel and picture types were added to support
raster graphics.)
Integer,
real, and
boolean are types common to most programming languages. The file type is an
input/output (I/O)
stream that allows writing or reading data objects. The
string type in many languages at that time was considered a
compound type, but including it as a native type makes the basic operations of concatenation, substring selection, length, and the comparisons (equals, less than, etc.) easier to use. It is much more pleasant than the arrays of characters used in Pascal. and the problems with
dangling pointers. The control identifier is constant and cannot be modified inside the loop. Also conventional are the while do and repeat while loops. The repeat while do construct provides the early exit or "n-and-a-half" loop.
Abstractions S-algol abstracts expressions as functions and statements (void expressions) as procedures.
Modules would provide the abstraction of declarations, but S-algol does not include modules because of the difficulties they pose with block-structured scope. The final syntactic category is sequencer, or control structure. Tennent used the term
sequel for the abstraction over sequencers, these would be generalizations of
goto and
break. The best known abstraction in this category is
call-with-current-continuation, but it would not be well understood until some years later. S-algol does not include goto or break, and does not include abstraction over sequencers.
Declarations and parameters Every data object in S-algol must be given a value when it is declared. This corresponds to
call by value parameter passing and removes the possibility of using an uninitialised value. In fact call by value is the only parameter passing method in S-algol. Reference and result parameters are rejected, which is consistent with the S-algol ban on passing
l-values. Structures and vectors are passed as pointers to the objects, but this is still call by value as the behavior is the same as the value used on the right side of assignments. Every declaration has a parametric equivalent. All procedure parameter types must be specified. Any procedure passed as a parameter has its full type specified (in contrast to Pascal) and the same is true for a structure class.
Input output model S-algol provides the file data type for I/O streams, and several variations of read and write are defined to operate on the basic types. It is expected that individual implementations will extend these simple facilities as needed.
Concrete syntax ALGOL languages have been criticized as being verbose. S-algol attempts to improve this by providing less restrictive syntax. This is demonstrated mostly in the declaration syntax. Since variable declarations must always include an initial value, the type does not need to be specified explicitly. Although it would be possible to infer procedure parameter and return types by examining where the procedure is called, S-algol does require parameter and return types to be specified. This is a practical decision, since it should be possible to understand a procedure without examining its calls. Most ALGOLs require that all declarations come before the statements in a block. In S-algol, declarations may be mixed with statements because everything must be declared before it is used and there is no goto that would permit jumping past a declaration. ==See also==