[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Compilation and package system
Date: Thursday, 11 April 1985 00:35-EST
From: Kent M Pitman <KMP at SCRC-STONY-BROOK.ARPA>
Don't be silly. Common Lisp programs don't have to run gracefully in all
implementations, they just have to run. If a person has written -*- ... -*-
and not put (IN-PACKAGE ...), he has not written a common lisp program.
Right. That was what I said in the last paragraph in my original message on
this topic.
The Lisp Machine simply (and reasonably) suggests that in order to work
compatibly with non-Common-Lisp utilities and still be portable, you should
do -*- ... -*- and (IN-PACKAGE ...), redundantly.
Right. That's the way Spice Lisp works, too, more or less, as I've explained.
The difference in the two implementations comes up in only one case, but a very
common one. If, in CLCP, I load or compile a file with a -*- comment that puts
it in package FOO, and package FOO does not exist, then I get an error. Every
time this has happened to me, it has been the case that the first form of FOO
would have created the package.
Of course, for this sort of thing I usually just write:there's the
alternate syntax:
;;; -*- Package: ("HACK" :USE ("LISP" "ACCINT" "SAPPH" "SESAME")) -*-
which seems to work OK...
What about IMPORT and friends? Those matter, too.
Putting it in a comment is mostly likely to win in all languages since
nearly every language has a comment syntax and I know of no languages for
which the comment syntax is not compatible with -*- ... -*-.
The example I gave above, with the FOO package, leads to a situation where the
Lisp Machine signals an error when handed a valid program. That would suggest
that Common Lisp is a language which is not compatible with -*- comments, as
interpreted the Lisp Machine way.
If you think this is nitpicking, fine: we'll drop it. I doubt many man-years
will be lost fixing headers while porting between Common Lisp dialects. The
problem has annoyed at least one Common Lisp programmer, however.
--Skef