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

My $0.02 on packages

My opinion is that the REAL problem with packages
is that the business of keeping separate name spaces
for independent programs shouldn't be done with the reader
at all! I think this is the root of the problem and won't
be solved regardless of the decision about a separate keyword 
package. I've had innumerable problems with this stuff dating
back to the obarray feature of MacLisp.

The purpose of packages is so that programs can have their
own private local functions and variables. It seems to me
the logical place to put this is in the function and variable
lookup mechanism, not with the mechanism the reader uses to 
create symbols. 

Here's a suggestion for doing this: 
The function and variable values for the current package are in 
the function and value cells, as usual. Values for other packages 
are in a data structure associated with the package. Thus a colon
would tell SYMEVAL and FSYMEVAL to look in the package rather than the
symbol. PKG-GOTO would swap the values between a package and
value cells of symbols.
(I realize this is very different than what's there now, and might
require incompatible changes.)

This scheme has the property that it doesn't interact with the
reader (or printer) at all, so there's ABSOLUTELY no problem with keywords, 
or typein!