[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compilation and package system



    (1)...  It's OK to have the -*- in ADDITION to the
    portable forms that specify package setups, but it's purely optional
    from the point of view of the Common Lisp evaluator and compiler.

Right!

I'm not sure what all gets tangled up in the Zetalisp compiler when
CLCP is turned on, but maybe something like the following would fly:
Use a slightly different notation in the comment line for each of the
three cases of interest:

A. This is a Zetalisp-style file comment, and the editor can get all
that it needs right here in this comment line.

B. This is vanilla Common Lisp, but it follows the convention (as in
Zetalisp and the vast majority of Spice Lisp code) that the whole file
fits into one package environment that is set by in the first few forms
in the file.  The first time the user asks for some form in the buffer
to be read into Lisp or compiled, the system would first execute these
opeing forms, stopping when it hits something non-package-related.
(Or we could use some explicit marker telling the system when to stop.)
In this case, if there is a "Package:Foo" in the -*- line, that is
shorthand for "Don't bother reading anything in the file -- all you need
to know is that the first statement is a simple (in-package "FOO").

C. This is vanilla Common Lisp with no guarantees about the package
structure in the file.  If the user actually asks for something in the
buffer to be read into Lisp or compiled, the system must first read
everything up to that point in order to be sure that the environment is
right.  The system could query him to see if he wants to go through with
this.

Note that this is not an extension to Common Lisp, but merely a
convention that those implementations with embedded Emacs-like editors
might adopt to make code-sharing easier.

-- Scott