[Openmcl-devel] Ordering constaints

Daniel Weinreb dlw at itasoftware.com
Fri May 21 15:37:15 PDT 2010


Is there any centralized documentation of the ordering
constraints on forms in a Lisp program, within a
compilation unit?  To put it in old lanaguage, what
forward references are and are not allowed?

For example, if I'm not mistaken:

- A form that declares a variable special must preceed
a use of the variable.  (The fact that the declaring
special happens at compile time is in the spec.)

- The definition of a macro must preceed any use of
the macro.  (The fact that it gets defined at compile
time is in the spec.)

- The definition of a function used by a macro must
preceed any use of the macro.  Also, it has to
be in an eval-when with :compile-toplevel, or else loaded before the
macro is used.

Of course, a function does not have to be defined
before a call to the function is seen.

Declaring a type does not have to be seen before
the type is used in as the :type in a defclass
or inside another deftype.

Using a class as a subtype in defclass does not
require that the class be defined first.









More information about the Openmcl-devel mailing list