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

Re: macrolet/flet/labels

Until the issue has been resolved, it seems like a good idea to avoid
shadowing ANY function or macro in CLtL with MACROLET/FLET/LABELS, but
especially special forms.

For example,  suppose that you had

(flet ((cons (x y) (cons y x)))
   (unwind-protect (my-call) (my-cleanup)))

In some systems, unwind-protect might be implemented as a macro which
expands into something that invokes CONS.

The primary problem is the possibility of references to Common Lisp
functions and special forms within macros invoked within the scope of
the FLET, LABELS or MACROLET. Until there is a macro expansion mechanism
universally adopted which protects macro references from unexpected
local rebindings, you're best off avoiding the whole problem by not
shadowing functions whose references you have no control over.