For Gauche 0.9.5


Previous: , Up: Introduction   [Contents][Index]

1.2 Notations


Next: , Previous: , Up: Notations   [Contents][Index]

1.2.1 Entry format

In this manual, each entry is represented like this:

Category: foo arg1 arg2

[spec] Description of foo …

Category denotes the category of the entry foo. The following categories will appear in this manual:

FunctionA Scheme function.
Special FormA special form (in the R7RS term, “syntax”).
MacroA macro.
ModuleA module
ClassA class.
Generic FunctionA generic function
MethodA method
Reader SyntaxA lexical syntax that is interpreted by the reader.
ParameterA parameter, which is a procedure that follows a certain protocol and used to manipulate the dynamic environment. See Parameters, for the details.
Generic applicationIn Gauche, you can “apply” a non-procedure object to arguments as if it is a procedure (see Applicable objects, for the details). This entry explains the behavior of an object applied to arguments.

For functions, special forms and macros, the entry may be followed by one or more arguments. In the argument list, the following notations may appear:

arg …

Indicates zero or more arguments.

:optional x y z
:optional (x x-default) (y y-default) z

Indicates it may take up to three optional arguments. The second form specifies default values to x and y. This is Gauche’s enhancement to Scheme; see Making Procedures for the definition of complete argument list syntax.

:key x y z
:key (x x-default) (y y-default) z

Indicates it may take keyword arguments x, y and z. The second form shows the default values for x and y. This is also Gauche’s enhancement to Scheme; see Making Procedures for the definition of complete argument list syntax.

:rest args

Indicates it may take rest arguments. This is also Gauche’s enhancement to Scheme; see Making Procedures for the definition of complete argument list syntax.

The description of the entry follows the entry line. If the specification of the entry comes from some standard, its origin is noted in the bracket at the beginning of the description. The following origins are noted:

[R7RS]
[R7RS+]
[R6RS]
[R6RS+]
[R5RS]
[R5RS+]

The entry works as specified in R7RS, R6RS or R5RS, respectively. If a plus sign is appended such as "[R7RS+]", the entry has extended functionality.

Since R7RS is mostly upward-compatible to R5RS, and has a lot in common with R6RS, we mark an entry as R5RS or R6RS only if it is not a part of R7RS.

[SRFI-n]
[SRFI-n+]

The entry works as specified in SRFI-n. If it is marked as "[SRFI-n+]", the entry has additional functionality.

[POSIX]

The API of the entry reflects the API specified in POSIX.


Previous: , Up: Notations   [Contents][Index]

1.2.2 Names and namespaces

Since R6RS, you can split toplevel definitions of Scheme programs into multiple namespaces. In the standards such namespaces are called libraries. Gauche predates R6RS and has been calling them modules, and we use the latter throughout this manual.

(Note: RnRS libraries are more abstract concept than Gauche’s modules; RnRS defines libraries in a way that they can be implemented in various ways, and it just happens that Gauche realises the library semantics using modules. When you write a portable R7RS library, be aware not to rely on Gauche-specific module semantics. Especially, RnRS libraries are more static than Gauche modules; you cannot add definitions to exiting libraries within RnRS, for example.)

Sometimes the same name is used for multiple definitions in different modules. If we need to distinguish those names, we prefix the name with the module name and a hash sign. For example, gauche#lambda means lambda defined in gauche module. This does not mean you can write gauche#lambda in the source code, though: This notation is just for explanation.


Previous: , Up: Notations   [Contents][Index]