[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problems with packages
- To: email@example.com, firstname.lastname@example.org
- Subject: Re: problems with packages
- From: haible (Bruno Haible)
- Date: Wed, 1 Feb 95 01:35:10 +0100
Dan Stanger <email@example.com> reports the following problem with SHADOW:
> (defpackage "SETS-PACK" (:use "COMMON-LISP" "CLOS")
> (:shadow "SETS" "INTERSECTION")
> (:export "SETS" "INTERSECTION"))
> (use-package "SETS-PACK")
> ** - Continuable Error
> 1 name conflicts while executing USE-PACKAGE of (#<PACKAGE SETS-PACK>)
> into package #<PACKAGE USER>.
The :shadow option to DEFPACKAGE only prohibits name conflicts in package
The conflict appears because package USER also has to choose among
LISP:INTERSECTION and SETS-PACK:INTERSECTION.
Michael Stoll has developed the following trick to handle this.
In your SETS-PACKAGE add a macro (which you export as well):
(eval-when (eval load)
(defmacro use-sets-package ()
`(progn (shadowing-import (list (find-symbol "INTERSECTION" "SETS-PACKAGE"))
Then, instead of writing (use-package "SETS-PACKAGE"), you only write
This is, admittedly, a bit clumsy. Has anyone found another solution to this