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

The compiler and packages.

Well, Mr. Moon, I gave your comment some thought.  It was a bit terse,
but perhaps this is what you meant:

What happens if a macro calls a function during the expansion of a
macro call?  If that function is in, say, the "USER" package, and the
compiler were to make the current package "SPECIAL-COMPILER-PACKAGE-
THAT-NO-ONE-ELSE-USES", then indeed the function wouldn't be found
at compile time.

But then again, it wouldn't be found if the user didn't happen to be
in the "USER" package when compiling the program.  If the program
must be compiled in the "USER" package, it ought to do an IN-PACKAGE
at the top.

If I read you wrong, please let me know.

By the way, here's what VAX LISP currently does:  If the compiler goes
to dump a symbol which is in the current package (not any special
compiler package), then it dumps it without a package.  This means
it will be loaded into the current package at the time of loading.
I don't think this is quite right, since it means that if I'm in
the "FOO" package when I compile, and I say FOO::SYM, and then I'm
in "BAR" when I load it, SYM will end up in "BAR" rather than "FOO".
To avoid this problem, I think you need the special compiler package.

- Paul