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

package question



Suppose we have the following:

	* *PACKAGE*
	#<A package named USER> ;
	* (SETQ P 'LISP::NEW-SYMBOL)
	LISP::NEW-SYMBOL ;
	* (IMPORT P *PACKAGE*)
	T ;
	* P
	NEW-SYMBOL ;
	* (UNINTERN P (SYMBOL-PACKAGE P))
	T ;
	* P
	#:NEW-SYMBOL
	* (FIND-SYMBOL "NEW-SYMBOL" *PACKAGE*)
	#:NEW-SYMBOL ;
	:INTERNAL ;
	* (EQ * P)
	T ;
	* 'NEW-SYMBOL
	#:NEW-SYMBOL
	* (EQ * P)
	T ;

We have an inconsistency here since printing does not equal reading.
Should the reader give the symbol a home if it does not have one?
Or should the printer be noticing that a symbol with no home is
in fact accessible in the current package (and not prefix with #:)?

	* (IMPORT P *PACKAGE*)
	T ;
	* P
	NEW-SYMBOL ;
	* 'NEW-SYMBOL
	NEW-SYMBOL ;
	* (EQ * P)
	T ;

Is IMPORT doing the right thing by giving the symbol a home package
if it does not have one?

--David