home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.lisp
- Path: sparky!uunet!wupost!sdd.hp.com!usc!rpi!batcomputer!cornell!raman
- From: raman@cs.cornell.edu (T. V. Raman)
- Subject: Re: Weird lucid behaviour: calling macros inside files at top level
- Message-ID: <1992Aug12.123449.5482@cs.cornell.edu>
- Keywords: macros, automatic defstructs
- Organization: Cornell Univ. CS Dept, Ithaca NY 14853
- References: <1992Aug11.203152.26760@cs.cornell.edu> <16a9a7INNq3@early-bird.think.com>
- Date: Wed, 12 Aug 1992 12:34:49 GMT
- Lines: 48
-
- barmar@think.com (Barry Margolin) writes:
-
- >In article <1992Aug11.203152.26760@cs.cornell.edu> raman@cs.cornell.edu (T. V. Raman) writes:
- >>I have a macro that expands into a defstruct. The defstruct is of type
- >>list, and the field names are obtained from a list.
-
- >It would help if you posted the code. It's hard to get a precise
- >understanding of what you're doing from the above description.
-
- >I suspect your problem is that you aren't assigning the list to the
- >variable at compile time (i.e. with (EVAL-WHEN (COMPILE) ...)), or you're
- >side effecting a constant.
-
- I suspect that the reason is the above. I have never used eval-when
- and in my code I simply have
-
- (defvar *list-of-dimensions* ...)
-
- and some calls at top level in the file that push items on to this
- list using
- (push item *list-of-dimensions*)
-
- So I guess there is something about evaluating things at compile-time
- that I never learnt about.
-
- Could you summarize for me what eval-when does and where and how it is
- normally used?
-
- Thanks,
-
- --Raman
-
-
- p.S. If you feel that replying to this on the net would be of little
- else to everyone else, I would appreciate it if you could reply to me
- by email
-
-
- >--
- >Barry Margolin
- >System Manager, Thinking Machines Corp.
-
- >barmar@think.com {uunet,harvard}!think!barmar
- --
- T. V. Raman <raman@cs.cornell.edu>Tel: (607)255-7421 R 272-2435
- Office: 5162 Upson Hall,
- Department of Computer Science, Cornell University Ithaca NY 14853-6201
- Res: 226 Bryant Avenue Ithaca NY 14850
-