Re: package frenzy
- From: Joris Bleys <jorisb@xxxxxxxxxxxxxx>
- Date: Mon, 30 May 2005 15:56:15 +0200
Hi Peter,
For starters, presumably you're using READ not READ-LINE as the latter returns a string, not a symbol. Or you're using READ-LINE and then INTERN to create a symbol, which is arguably a better plan that using READ so you don't have to worry about READ reading some other kind of object.
Actually I'm using (read-from-string "COMMAND extra stuff which ain't important" NIL NIL) which returns COMMAND as a symbol. I initially mispelled this as I thought this was not of major influence on my problem at hand).
At any rate, the problem you're having is that READ and INTERN both use the runtime value of *PACKAGE* to determine how to find/intern symbols. So it doesn't matter that ep-internal-fn happens to be defined in a file that is read with a particular *PACKAGE*--what matters is what *PACKAGE* is when it is called.
Ok, I agree to you this indeed is the problem and the solution. I just find it a bit difficult for a programmer to make sure symbols are created in the right package. I wonder when calling an internal function, the *package* is not automatically changed to the package to the one in which it was defined.
Thanks for your help!
Joris
.
- Follow-Ups:
- Re: package frenzy
- From: Peter Seibel
- Re: package frenzy
- References:
- Re: package frenzy
- From: Peter Seibel
- Re: package frenzy
- Prev by Date: Re: package frenzy
- Next by Date: Re: package frenzy
- Previous by thread: Re: package frenzy
- Next by thread: Re: package frenzy
- Index(es):
Relevant Pages
|