Chapter 2

Syntax

Dylan Interchange Format

The Dylan interchange format is a standard file format for publishing Dylan source code. Such a file has two parts, the file header and the code body. The file header comes before the code body.

The code body consists of a source record.

The file header consists of one or more keyword-value pairs, as follows:

The file header cannot contain comments, or other Dylan source code.

Blank lines may not appear in the file header. A blank line defines the end of the file 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:

language: language-name [Header keyword]


The source record in the file is written in the named language. The only portable value for this keyword is infix-dylan.

module: module-name [Header keyword]


The source record in the file is associated with the named module. This keyword is required.

author: text [Header keyword]
copyright: text [Header keyword]
version: text [Header keyword]


These are provided for standardization. They are optional, and can be ignored by the implementation.

A typical Dylan source file might look like this:

module: quickdraw
author: J. Random Rect
        Linear Wheels, Inc., "Where quality is a slogan!"
        rect@linear.com
copyright: (c) 1995 Linear Wheels, Inc., All rights reserved
version: 1.3 alpha (not fully tested)

define constant $black-color = ...