[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
problems with packages
- To: email@example.com, firstname.lastname@example.org
- Subject: problems with packages
- From: email@example.com (Dan Stanger)
- Date: Tue, 31 Jan 1995 16:58:00 -0700
- Cc: firstname.lastname@example.org
i have the following 3 files.
(defpackage "SETS-PACK" (:use "COMMON-LISP" "CLOS")
(:shadow "SETS" "INTERSECTION")
(:export "SETS" "INTERSECTION"))
(defclass sets ()
((tipe :accessor tipe :initarg :tipe)
(elements :accessor elements)))
(defgeneric intersection (a b &key test test-not key))
(defmethod intersection ((s1 sets) (s2 sets) &rest more)
(unless (equal (tipe s1) (tipe s2)) (error "bad type"))
(apply #'lisp:intersection (elements s1) (elements s2) more))
(defmethod intersection ((s1 sequence) (s2 sequence) &rest more)
(apply #'lisp:intersection s1 s2 more))
and more p.lsp
(setf a (make-instance 'sets :tipe 't))
when i execute clips as follows i get the error
clisp -q -i c.lsp
;; Loading file c.lsp ...
;; Loading file /home/dxs/l/s.lsp ...
;; Loading of file /home/dxs/l/s.lsp is finished.
;; Loading file /home/dxs/l/p.lsp ...
** - Continuable Error
1 name conflicts while executing USE-PACKAGE of (#<PACKAGE SETS-PACK>) into package #<PACKAGE USER>.
If you continue (by typing 'continue'): You may choose for every conflict in favour of which symbol to resolve it.
which symbol with name "INTERSECTION" should be accessible in #<PACKAGE USER> ?
1 -- SETS-PACK
2 -- USER
i thought that shadowing intersection would eliminate this problem.
does anybody have any ideas on this?