Previous: , Up: Notational Conventions   [Contents][Index]


1.1.3 Entry Format

Each description of an MIT/GNU Scheme variable, special form, or procedure begins with one or more header lines in this format:

category: template

where category specifies the kind of item (“variable”, “special form”, or “procedure”). The form of template is interpreted depending on category.

Variable

Template consists of the variable’s name.

Parameter

Template consists of the parameter’s name. See Dynamic Binding and Parameters for more information.

Special Form

Template starts with the syntactic keyword of the special form, followed by a description of the special form’s syntax. The description is written using the following conventions.

Named components are italicized in the printed manual, and uppercase in the Info file. “Noise” keywords, such as the else keyword in the cond special form, are set in a fixed width font in the printed manual; in the Info file they are not distinguished. Parentheses indicate themselves.

A horizontal ellipsis (…) is describes repeated components. Specifically,

thing

indicates zero or more occurrences of thing, while

thing thing

indicates one or more occurrences of thing.

Brackets, [ ], enclose optional components.

Several special forms (e.g. lambda) have an internal component consisting of a series of expressions; usually these expressions are evaluated sequentially under conditions that are specified in the description of the special form. This sequence of expressions is commonly referred to as the body of the special form.

Procedure

Template starts with the name of the variable to which the procedure is bound, followed by a description of the procedure’s arguments. The arguments are described using “lambda list” notation (see Lambda Expressions), except that brackets are used to denote optional arguments, and ellipses are used to denote “rest” arguments.

The names of the procedure’s arguments are italicized in the printed manual, and uppercase in the Info file.

When an argument names a Scheme data type, it indicates that the argument must be that type of data object. For example,

procedure: cdr pair

indicates that the standard Scheme procedure cdr takes one argument, which must be a pair.

Many procedures signal an error when an argument is of the wrong type; usually this error is a condition of type condition-type:wrong-type-argument.

In addition to the standard data-type names (pair, list, boolean, string, etc.), the following names as arguments also imply type restrictions:

  • object: any object
  • thunk: a procedure of no arguments
  • x, y: real numbers
  • q, n: integers
  • k: an exact non-negative integer

Some examples:

procedure: list object …

indicates that the standard Scheme procedure list takes zero or more arguments, each of which may be any Scheme object.

procedure: write-char char [output-port]

indicates that the standard Scheme procedure write-char must be called with a character, char, and may also be called with a character and an output port.


Previous: Examples, Up: Notational Conventions   [Contents][Index]