>>>>> "ew" == Edi Weitz <[EMAIL PROTECTED]> writes:

  ew> <http://groups.google.com/groups?threadm=3243682048034314%40naggum.no>
  ew> 
  ew> but nobody replied. Maybe someone here has the specific answer for
  ew> CMUCL at least?

you can get the behaviour that Erik is looking for by calling
EVAL:FLUSH-INTERPRETED-FUNCTION-CACHE each time you redefine a macro,
by encapsulating #'(setf macro-function). This only works with
interpreted code, of course. 

,----
| USER> 
|  (ext:encapsulate '(setf macro-function) 'ecm-flush-interpreted-macroexpansions
|     '(progn
|        (eval:flush-interpreted-function-cache)
|        (apply ext:basic-definition ext:argument-list)))
| #<Closure Over Function "DEFUN ENCAPSULATE" {4822BBE1}>
| USER> (defmacro macro-expansion-test ()
|          (print "I'm being expanded!")
|          `(print "I'm the expansion!"))
| macro-expansion-test
| USER> (defun expanded-when ()
|         (macro-expansion-test))
| expanded-when
| USER> (expanded-when)
| "I'm being expanded!" 
| "I'm the expansion!" 
| "I'm the expansion!"
| USER> (expanded-when)
| "I'm the expansion!" 
| "I'm the expansion!"
| USER> (defmacro macro-expansion-test ()
|         (print "I'm being expanded again!")
|         `(print "I'm the new expansion!"))
| macro-expansion-test
| USER> (expanded-when)
| "I'm being expanded again!" 
| "I'm the new expansion!" 
| "I'm the new expansion!"
| USER> (expanded-when)
| "I'm the new expansion!" 
| "I'm the new expansion!"
| USER> 
`----

-- 
Eric Marsden                          <URL:http://www.laas.fr/~emarsden/>

Reply via email to