Syntax of Dylan FilesA Dylan source code file is a standard portable file format for publishing Dylan source code. Such a file has two parts, the header and the body. The header comes before the body.
The body consists of zero or more outer expressions and comments.
The header consists of one or more keyword-value pairs, as follows:
The header cannot contain comments.
- The syntax of a keyword is as follows: a keyword is a letter, followed by zero or more letters, digits, and hyphens, followed by a colon, contains only characters from the ISO 646 7-bit character set, and is case-independent.
- A keyword begins on a new line, and cannot be preceded by whitespace.
- All text (excluding padding whitespace) between the keyword and the newline is considered to be the value. Additional lines can be added by having the additional lines start with whitespace. Leading whitespace is ignored on all lines.
- Interpretation of the value is determined by the keyword.
- Implementations must recognize and handle standardized keywords properly, unless the specification for a keyword explicitly states that it can be ignored.
- When importing a file, implementations are free to ignore any non-standard keyword/value pair that they do not recognize.
- When exporting a file, implementations must use standard keywords properly. Implementations are free to use non-standard keywords.
- The definition of a keyword may specify that the keyword may occur more than once in a single file header. If it does not, then it is an error for the keyword to occur more than once. If it does, it should specify the meaning of multiple occurences.
Blank lines may not appear in the header. A blank line defines the end of the header and the beginning of the code body. The blank line is not part of the code body. (A "blank line" is a line consisting of zero or more space or tab characters, ending in a newline character.) The following standard keywords are defined:
module: module-name [Header keyword]
Expressions in the file are associated with the named module. This keyword is required.
author: arbitrary text [Header keyword] copyright: arbitrary text [Header keyword] version: arbitrary text [Header keyword]
These are provided for standardization. These are optional, and can be ignored by the implementation.Next section: 3. Variables
A typical Dylan source file might look like this:module: quickdraw author: J. Random Rect Linear Wheels, Inc., "Where quality is a slogan!" firstname.lastname@example.org copyright: (c) 1993 Linear Wheels, Inc., All rights reserved version: 1.3 alpha (not fully tested) define constant $black-color = ... ...