[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: pyrnj!pyramid!bein@RUTGERS.EDU
- Subject: Re: macrolet/flet/labels
- From: masinter.pa@Xerox.COM
- Date: Tue, 27 Oct 1987 15:18:00 -0000
- Cc: email@example.com
- In-reply-to: pyrnj!pyramid!bein%RUTGERS:EDU:Xerox's message of 24 Oct 87 21:09
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.