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

  1. Path: sparky!uunet!dtix!darwin.sura.net!zaphod.mps.ohio-state.edu!think.com!barmar
  2. From: barmar@think.com (Barry Margolin)
  3. Newsgroups: comp.lang.lisp
  4. Subject: Re: exported symbols, and packages:
  5. Keywords: export symbol package
  6. Message-ID: <18r7h9INNb5m@early-bird.think.com>
  7. Date: 11 Sep 92 22:44:57 GMT
  8. References: <1992Sep11.193138.3277@cs.cornell.edu>
  9. Organization: Thinking Machines Corporation, Cambridge MA, USA
  10. Lines: 36
  11. NNTP-Posting-Host: telecaster.think.com
  12.  
  13. In article <1992Sep11.193138.3277@cs.cornell.edu> raman@cs.cornell.edu (T. V. Raman) writes:
  14. >I find that when in the user package all symbols that are exported
  15. >from other packages are present in the user package as symbols. ie:
  16.  
  17. I don't think that's what is happening.
  18.  
  19. >If I have a package *foo* that exports a  function #'foo  then if in
  20. >the user package there is a symbol 'foo presents which evaluates to
  21. >itself.  (find-symbol 'foo) returns
  22. >
  23. >foo
  24. >:internal
  25.  
  26. Try (find-symbol "FOO" '*foo*).  It should return something like:
  27.  
  28. *FOO*:FOO
  29. :EXTERNAL
  30.  
  31. >Is this what is supposed to happen? If so why?  Why should the symbol
  32. >'foo be present in the user package in this way?
  33.  
  34. When you typed the form (find-symbol 'foo), the reader interned the symbol
  35. that you typed into the current package, creating a new symbol named "FOO"
  36. in the USER package if necessary.  Try (eq 'foo 'foo:foo); I'll bet it
  37. returns NIL.
  38.  
  39. Note that the first argument to FIND-SYMBOL and INTERN is required to be a
  40. string, not a symbol.  If your implementation permits you to use a symbol
  41. there, that's an extension.  Neither Symbolics Common Lisp nor CMU CL
  42. permit it, but Lucid CL does.
  43.  
  44. -- 
  45. Barry Margolin
  46. System Manager, Thinking Machines Corp.
  47.  
  48. barmar@think.com          {uunet,harvard}!think!barmar
  49.