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

MCL package mysteries - can somebody explain?

I am moving a large amount of my code from Franz Allegro lisp
(Apollo platform, Steele Ed. 1) into MCL 2.01b, and have
encountered problems with the package functions.  Being a
diligent manual reader and very experienced lisp programmer, I
studied the manual and Steele #2 carefully, but then I had a lot
of fist-fights trying to get the  packages to work in MCL like I
thought they  should.  The only way I made any progress was
trying to mimic the MCL distribution examples, but these make
only an extremely limited use of the package functions (e.g.
usually they just IN-PACKAGE to CCL).  

My concern is that even if I get it working, what I've got is
idiosyncratic to MCL, and won't port to other Steele #2

At this point, I have concluded that one of the following is

1.  Steel didn't define or explain DEFPACKAGE correctly.

2. The MCL package functions have lots of bugs, producing
confusions and inconsistencies.

3. MCL does not in fact conform to the new (Steel #2)
definitions, but uses something different.

For example: Steele doesn't suggest keywords for package names,
but they seem to be used exclusively in the MCL examples. Strings
or symbols for package names don't seem to work like they should.
The IMPORT and EXPORT parts of DEFPACKAGE don't seem to work like
Steele says they should.  I've observed inconsistences in that
the user package (COMMON-LISP-USER) can be listed as USING
another package, but symbols in that other package are apparently
not always recognized. Once the user package sees an undefined
symbol qualified with a different package name, it then owns the
symbol, and so it is a mess trying to give it the proper package.

If this sounds confused, it's because I saw lots of weird stuff
going on, so I'm confused.  Clearly, some of these problems might
have been caused by other problems, and so might have the nature
of unreproducible bugs.  The point is that I was shocked to be
reduced to trial-and-error search through Alice's Wonderland of
strange behaviors here.

Can anybody explain what is going on here?  Please don't just
quote Steele - the problem is that I can't seem to get
Steele-based code to work.  Does MCL in fact conform to Steele #2
in the package functions?

What would be most helpful would be if somebody can extract and
post here an example consisting of  the package statements from a
set of working MCL files for a reasonably complex package setup,
something like my situation, which is:

All the packages use everything in MCL, and nothing is shadowed. 
UTILITY's exported symbols. COMMON-LISP-USER, PARSER, and PPS
all use WINDOW-FUNCS's exported symbols. COMMON-LISP-USER uses
PARSER's and PPS's exported symbols.

This isn't so hairy, actually, but I haven't been able to get
this setup duplicated in MCL in a way that I can explain or