How to Easily Specify Export Symbol
- From: "joesb" <joesb.coe9@xxxxxxxxx>
- Date: 31 Aug 2005 02:31:26 -0700
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.
.
- Follow-Ups:
- Re: How to Easily Specify Export Symbol
- From: Marco Antoniotti
- Re: How to Easily Specify Export Symbol
- Prev by Date: Re: Lisp object code versus that of other languages
- Next by Date: Re: Lisp object code versus that of other languages
- Previous by thread: SECD machine and compiler
- Next by thread: Re: How to Easily Specify Export Symbol
- Index(es):
Relevant Pages
|