Comment 10 for bug 632368

Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

Using the call-site lexenv for inline function OPTIMIZE policy is convenient and defendable.

Inline-expansions seeing macros from the call-site would be just wrong:

 (defun xxx () :fun)

 (declaim (inline foo))
 (defun foo () (xxx))

 (defun bar ()
   (macrolet ((xxx () :macro))
     (foo)))

BAR *must* return :FUN.

Compiler-macro expansions... Hair and pain. Currently

  (define-compiler-macro foo () `(xxx))

and recompiling the BAR above causes it to return :MACRO, which strikes me as deeply suspect. Even if this might be convenient for rare cases, in the large this can only produce subtle and hard to find bugs.