Programming Language for Old Timers


by David A. Moon
February 2006 .. September 2008

Comments and criticisms to dave underscore moon atsign alum dot mit dot edu.


Previous page   Table of Contents   Next page


Program Syntax

A program source file consists of a sequence of expressions.

Any expression can be preceded by the keyword module:, in which case the expression must evaluate to a module and the remaining expressions are parsed in that module. The expression can be a defmodule or a name whose definition is a module.

If the keyword syntax: appears at the top level of a program, it is followed by a name. If the name is xyz, the remainder of the source file is parsed by calling parse-xyz rather than parse-expression. This allows switching to an alternative user-defined syntax without having to change the compiler. Any parsing function that returns a P-Expression can be used.

Any expression can be preceded by the keyword export:, in which case the expression must parse as a name, a definition, or a collation containing definitions. Each name defined is exported from the current module. If the expression is just a name, that name is exported from the current module.


Previous page   Table of Contents   Next page