home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / lisp / 2200 next >
Encoding:
Text File  |  1992-08-12  |  2.0 KB  |  60 lines

  1. Newsgroups: comp.lang.lisp
  2. Path: sparky!uunet!wupost!sdd.hp.com!usc!rpi!batcomputer!cornell!raman
  3. From: raman@cs.cornell.edu (T. V. Raman)
  4. Subject: Re: Weird lucid behaviour: calling macros inside files at top level
  5. Message-ID: <1992Aug12.123449.5482@cs.cornell.edu>
  6. Keywords: macros, automatic defstructs
  7. Organization: Cornell Univ. CS Dept, Ithaca NY 14853
  8. References: <1992Aug11.203152.26760@cs.cornell.edu> <16a9a7INNq3@early-bird.think.com>
  9. Date: Wed, 12 Aug 1992 12:34:49 GMT
  10. Lines: 48
  11.  
  12. barmar@think.com (Barry Margolin) writes:
  13.  
  14. >In article <1992Aug11.203152.26760@cs.cornell.edu> raman@cs.cornell.edu (T. V. Raman) writes:
  15. >>I have a macro that expands into a defstruct. The defstruct is of type
  16. >>list, and the field names are obtained from a list. 
  17.  
  18. >It would help if you posted the code.  It's hard to get a precise
  19. >understanding of what you're doing from the above description.
  20.  
  21. >I suspect your problem is that you aren't assigning the list to the
  22. >variable at compile time (i.e. with (EVAL-WHEN (COMPILE) ...)), or you're
  23. >side effecting a constant.
  24.  
  25. I suspect that the reason is the above. I have never used eval-when
  26. and in my code I simply have
  27.  
  28. (defvar *list-of-dimensions* ...)
  29.  
  30. and some calls at top level in the file that push items on to this
  31. list using
  32. (push item *list-of-dimensions*)
  33.  
  34. So I guess there is something about evaluating things at compile-time
  35. that I never learnt about. 
  36.  
  37. Could you summarize for me what eval-when does and where and how it is
  38. normally used?
  39.  
  40. Thanks,
  41.  
  42. --Raman
  43.  
  44.  
  45. p.S. If you feel that replying to this on the net would be of little
  46. else to everyone else, I would appreciate it if you could reply to  me
  47. by email
  48.  
  49.  
  50. >-- 
  51. >Barry Margolin
  52. >System Manager, Thinking Machines Corp.
  53.  
  54. >barmar@think.com          {uunet,harvard}!think!barmar
  55. -- 
  56.    T. V. Raman <raman@cs.cornell.edu>Tel: (607)255-7421 R 272-2435
  57.                Office: 5162 Upson Hall,
  58. Department of Computer Science, Cornell University Ithaca NY 14853-6201
  59.         Res: 226 Bryant Avenue Ithaca NY 14850
  60.