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

SCT and DEFPACKAGE question



Hi there.

I've got some puzzling behavior that I hope someone can explain to me.
I'm developing a KEE application that I recently developed a system
definition for. It's in its own package, call it X. Before switching to
SCT, the first file I loaded defined package X using straight Common
LISP. Now, following the Symbolics documentation, I have a DEFPACKAGE
form at the beginning of my SYSDCL file.

The package definition is pretty hairy, at least to me. Package X is
defined to use the KEE and LISP packages, and a couple of KEE-internal
packages.  The DEFPACKAGE includes multiple :IMPORT and :EXPORT clauses.
After the defpackage, I do (use-package '(x) 'kee) so my external symbols
will be available in the KEE lisp listener (which should read in the KEE
package).

Here's my puzzle: when I did the package definition without DEFPACKAGE,
it worked fine. When I do Compile System, the new form works as well.
However, when I do Load System, I find that some of the symbols I export
are NOT accessible from KEE at all, but are present there as separate
symbols; these are the symbols which are referenced in a knowledgebase I
load near the end of the system. Clutching at straws, I noticed that
doing Compile System loads the SYSDCL file twice, and Load System only
loads it once. So I tried loading it twice by hand, and then doing Load
System; this seemed to get me the correct behavior. So my question is:
why does my defpackage/use-package have to get evaluated twice in order
to work correctly?

Thanks for any help with this.

--John

John Nienart
NASA Ames Research Center
Internet: nienart@pluto.arc.nasa.gov

P.S. Please dont suggest that I shouldn't be using packages with KEE, or
that I ask IntelliCorp for help. I really need to do things this way, and
IC cannot help me.
-------