[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


        Date: 14 March 1980 23:37-EST
        From: Edward Barton <EB at MIT-AI>
        Re:   DEFVST
    What you want to say is not (eval-when (compile) (defvst ...)), but
    simply (defvst ...), at top level in your file.
    Use an incantation such as
      (eval-when (eval load compile)
        (cond ((status nofeature DEFVST) (load '((lisp) defvst))))) 
     ... if you mean that you don't want the macros cons-a-barf, barf-a, etc.
    to get output to the FASL file, just do
      (eval-when (compile)
        (setq defmacro-for-compiling () defmacro-displace-call ()))
    before the top level occurrence of defvst (but if you have other DEFMACROs
    you do want compiled, be sure to reset these magic variables to T).

Consider the following file:

(eval-when (eval compile load)
  (or (status feature defvst)
      (load '((lisp) defvst))))

(eval-when (compile)
    (setq defmacro-for-compiling nil defmacro-displace-call nil))

(defvst barf a b c)

(eval-when (compile)
    (setq defmacro-for-compiling t defmacro-displace-call t))

(defun foo ()
  (cons-a-barf a 1 b 2 c 3))

When FOO is loaded compiled, (struct-typep (foo)) is NIL.  Naturally this
causes foo-manipulating functions to lose.  Why does this happen?