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

Re: eval-when bug



This bug appears in KCL and every version of AKCL, and is not really
related to EVAL-WHEN.  It is caused by the way the KCL compiler arranges
to do the load-time package operations and interning of symbols that
are required by the file being compiled.  At load-time, the package operations
that were at top level in the source file are run, and all the file's symbols
are interned, BEFORE anything else is done.  In your example, LOAD attempts
to intern foobar in the package abc, before running the (unless ...) form.  
The make-package is not done first because it does not appear at top level.  

This is a fairly difficult bug to fix.

You can work around the bug, though, by (1) splitting files, or (2) using
package operations at top level wherever possible.  In you example, you could
(1) put the (unless ...) form in a separate file, or (2) replace the (unless ...) form
with (in-package 'abc)(in-package 'user).

Richard Harris