[armedbear-devel] FLET incorrectly optimized away

William Wadsworth will.wadsworth.10 at gmail.com
Sat Jun 26 13:51:29 UTC 2010


Hi,

It appears that the compiler mistakenly optimizes out local functions in, say,
definer macros. Below is a transcript of a sample session that clarifies the
problem:

CL-USER(1): (defmacro define-fn (name &body body)
              `(defun ,name () (flet ((%one () 1)) , at body)))
DEFINE-FN
CL-USER(2): (defmacro do-add1 () `(%one))
DO-ADD1
CL-USER(3): (define-fn fn1 (do-add1))
; Note: deleting unused local function FLET %ONE
FN1
CL-USER(4): (fn1)
#<THREAD "interpreter" {6DDDCF}>: Debugger invoked on condition of
type UNDEFINED-FUNCTION
  The function %ONE is undefined.
Restarts:
  0: CONTINUE     Try again.
  1: USE-VALUE    Specify a function to call instead.
  2: RETURN-VALUE Return one or more values from the call to %ONE.
  3: TOP-LEVEL    Return to top level.
[1] CL-USER(5): :res

Thanks.

Martin.




More information about the armedbear-devel mailing list