Re: How to Easily Specify Export Symbol
- From: Marco Antoniotti <marcoxa@xxxxxxxxxx>
- Date: Wed, 31 Aug 2005 10:48:35 -0400
In general you cannot mix and match easily.
You can have a look at tfb's "conduit" packages to achieve what you want.
http://www.tfeb.org/lisp/hax.html
Cheers -- Marco
joesb wrote:
Hi,
I was developing my own little package shadowing some of LISP function to be generic (<, >, equal, etc.).
So in my package.lisp, I have
(defpackage :cl-oo (:use :common-lisp) (:shadow :< :> :equal ...) ; Only list the symbol that I shadow (:export :< :> :equal ...)) ; Only list the symbol that I shadow
Now when I want to use this package, I thought I would do
(defpackage :my-app (:use :common-lisp :cl-oo))
Surely this won't work, A condition will be signaled because symbol in :cl-oo and common-lisp conflict.
I could have fixed this by declare the shadowing symbol.
(defpackage :my-app (:use :common-lisp :cl-oo) (:shadowing-import-from :cl-oo :< :> :equal ...))
But I don't want to repeat myself again like that. I want to be able to specify once somewhere, that, if these two packages are use together, symbols from :cl-oo package will shadow those in :common-lisp packages.
Only way I see is
(defpackage :cl-oo-wrapper (:import-from :common-lisp :defun :defmacro ...) ; All Symbol not shadow by :cl-oo (import-from :cl-oo :< :> :equal ...) ;All symbol exported by :cl-oo, and much more. (:export :defun :defmacro :< :> ...)) ;Merge of Symbols above
Then I can use this package
(defpackage :my-app (:use :cl-oo-wrapper))
But is the the best way to do it? Listing out all symbols seems not very smart to me.
.
- References:
- How to Easily Specify Export Symbol
- From: joesb
- How to Easily Specify Export Symbol
- Prev by Date: Re: modifying array access syntax
- Next by Date: Re: discrete event simulator
- Previous by thread: How to Easily Specify Export Symbol
- Index(es):
Relevant Pages
|
|