Eclipse defined
Macro WITH-UNIQUE-NAMES
Syntax:
with-unique-names (name*) form* => result*
Arguments and Values:
name---a variable to be renamed.
forms---an implicit progn.
results---the values of the forms.
Description:
With-unique-names executes forms in a context in which each name is bound to a similarly named uninterned symbol.
Example:
(defmacro lister (p q)
(with-unique-names (x y)
`(let ((,x (x-function))
(,y (y-function)))
(list ,p ,q ,x ,y))))
=> LISTER
(macroexpand '(lister i j))
=> (LET ((#1=#:X (X-FUNCTION))
(#2=#:Y (Y-FUNCTION)))
(LIST I J #1# #2#))
;; The actual uninterned symbol names may vary with different
;; implementations. For example, symbols produced by gensym
;; might be used.
Side Effects:
May increment *GENSYM-COUNTER*.
Affected By:
Symbol names be be effected by *GENSYM-COUNTER*.
Exceptional Situations: None.
See Also:
rebinding, gensym.
Notes:
With-unique-names is intended to facilitate the creation of hygienic macros, in which temporary variable bindings created within a macro use unique names so that there is no danger of unwanted variable capture.
With-unique-names is compatible with similarly named facilities in other Lisp implementations.