Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!cam-news-feed3.bbnplanet.com!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!uunet!in2.uu.net!192.35.48.11!hearst.acc.Virginia.EDU!murdoch!elvis.med.Virginia.EDU!sdm7g
From: sdm7g@elvis.med.Virginia.EDU (Steven D. Majewski)
Subject: more package madness...
X-Nntp-Posting-Host: elvis.med.virginia.edu
Message-ID: <E5wy7s.IE2@murdoch.acc.Virginia.EDU>
Sender: usenet@murdoch.acc.Virginia.EDU
Organization: University of Virginia
Date: Thu, 20 Feb 1997 18:04:40 GMT
Lines: 61

 Thanks for everyone who responded to my previous message and 
explained the reasoning behind Lisp's reader interning symbols
that I didn't want interned.  I now understand why it's implemented
that way, but I can't say it's a desirable design feature. 
( However, I suspect that Lisp packages were designed for larger
  grained packaging than I've been trying to do. How many packages
  are typical in a large lisp application ? ) 

Another example I recently ran into is that I find I can't say:

( if ( find-package "XXX" )
     ( defun function that uses XXX:func  ... ) 
     ( defun function that simulates XXX:func without reference to 
	that package  ... ))
 

  In this case, the external package has interfaces to drivers to
talk to a spectrometer and acquire data. The replacement functions
are so that I can test the graphics update and interface of the 
program on a machine without the data acquisition hardware. 

  However, even when the 'else' condition holds, I still get errors
from the reader reading the first clause and complaining about no 
package named "XXX" . 


 I first changed this conditional to use *features*, and right now 
I'm changing things so that I define an entire fake "XXX" simulation
package. This latter is probably the better solution to the problem,
however, now that I uncovered this problem in a simple example, I 
recognize that this sort of use of undefined symbols in a conditional
was probably the source of some similar errors that I had in other modules.
I those cases, the problem was disguised a bit more subtly. I believe
I just gave up on using conditional code in some of those cases and just
hardwired in the requirement that requires the other packages. 


I'm not convinced that the fact that the lisp reader does partial 
evaluation of statements with side effects in (possibly) the global
environment is an unmixed blessing as a feature. 


 I also find I've having trouble dealing with compile-time vs eval-time
issues: typically, I find I have to load all of my code, and then 
compile it to get it to compile without error. Perhaps it will compile
if I compile it in the "proper" order, but what I *can't* do is compile
each file in the directory in directory order.  


 "Load everything and compile" is an acceptable solution, but I wonder
whether my problems are a sign of my missing some other subtle word-
of-mouth, undocumented Lisp structuring principle! 



---|  Steven D. Majewski   (804-982-0831)  <sdm7g@Virginia.EDU>  |---
---|  Department of Molecular Physiology and Biological Physics  |---
---|  University of Virginia             Health Sciences Center  |---
---|  P.O. Box 10011            Charlottesville, VA  22906-0011  |---
         By doing just a little every day, you can gradually 
                let the task completely overwhelm you.
