home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / lisp / mcl / 1363 < prev    next >
Encoding:
Internet Message Format  |  1992-09-11  |  1.3 KB

  1. Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!data.nas.nasa.gov!taligent!apple!apple!cambridge.apple.com!bill@cambridge.apple.com
  2. From: bill@cambridge.apple.com (Bill St. Clair)
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: Re: MCL 2.0 final defsys package screw
  5. Message-ID: <9209111626.AA22277@cambridge.apple.com>
  6. Date: 11 Sep 92 17:34:32 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 22
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10. Full-Name: Bill St. Clair
  11. Original-To: nathan@akbar.teleos.com
  12. Original-Cc: kab@cambridge.apple.com (Kim Barrett), info-mcl
  13.  
  14. > Date: Thu, 10 Sep 92 18:09:48 EST
  15. > From: kab@cambridge.apple.com (Kim Barrett)
  16. > To: nathan@akbar.teleos.com
  17. > Subject: Re: MCL 2.0 final defsys package screw
  18. > Cc: info-mcl%cambridge.apple.com@apple.COM
  19. >
  20. > [...]
  21. >
  22. > Another (to me, clearer) way to write it is
  23. >
  24. >  (let ((*package* (if package (find-package package) *package*)))
  25. >    (load path))
  26.  
  27. This can get you in trouble if FIND-PACKAGE can't find a package
  28. with the given name and returns NIL. Binding *package* to NIL tends
  29. to make MCL very unhappy. Better would be:
  30.  
  31. (let ((*package* (if package 
  32.                    (or (find-package package)
  33.                        (error "There is no package named: ~s" package))
  34.                    *package*)))
  35.   (load path))
  36.