From ... From: Erik Naggum Subject: Re: eval-when? Date: 1999/11/03 Message-ID: <3150616834270740@naggum.no>#1/1 X-Deja-AN: 543903365 References: <7vnko2$icn$1@nnrp1.deja.com> mail-copies-to: never X-Complaints-To: newsmaster@eunet.no X-Trace: oslo-nntp.eunet.no 941628041 10235 195.0.192.66 (3 Nov 1999 11:20:41 GMT) Organization: Naggum Software; +47 8800 8879 or +1 510 435 8604; fax: +47 2210 9077; http://www.naggum.no NNTP-Posting-Date: 3 Nov 1999 11:20:41 GMT Newsgroups: comp.lang.lisp * Andrew Cooke | I have some code that may (or may not) use another package. If the code | is being used independently, I need to define something myself. So I | have some top-level code that looks like: | | (cond ((find-package "ZB") | (print "using zebu")) | (t | (print "no zebu") | (defstruct kb-domain))) | | But this doesn't work when the other package is present - kb-domain ends | up being defined in the current package and in ZB. I guess (I'm new to | this) that kb-domain as a symbol has been created by the reader, hence | the conflict. you guessed right. | Can anyone tell me what I am doing wrong (at any level of abstraction | below "using Lisp") - or, better, what I should be doing here? you can easily use the reader to support this shared-mode development. the key is to use #+ and #- and to add your own feature to the *FEATURES* list. to make sure this happens at the right time, you need to keep a few things straight, however. ;;first set up the feature in the reader -- make sure the value is harmless #.(progn (if (find-package "ZB") (pushnew :zebu *features*) (drop :zebu *features*)) nil) ;;now we can use conditional reader forms to select or skip forms #+zebu (print "using zebu") #-zebu (print "no zebu") hope this helps. #:Erik