All Manuals > LispWorks User Guide and Reference Manual > 40 The LISPWORKS Package

NextPrevUpTopContentsIndex

with-unique-names

Macro
Summary

Returns a body of code with each specified name bound to a similar name.

Package

lispworks

Signature

with-unique-names (&rest names) &body body => result

Arguments

names

The names to be rebound in body.

body

The body of code within which names are rebound.

Values

result

The result of evaluating body.

Description

Returns the body with each name bound to a symbol of a similar name (compare gensym).

Example

After defining

(defmacro lister (p q)
   (with-unique-names (x y)
      `(let ((,x (x-function))
             (,y (y-function)))
          (list ,p ,q ,x ,y))))

the form (lister i j) macroexpands to

(LET* ((#:X-88 (X-FUNCTION))
       (#:Y-89 (Y-FUNCTION)))
          (LIST i j #:X-88 #:Y-89))
See also

rebinding


LispWorks User Guide and Reference Manual - 13 Feb 2015

NextPrevUpTopContentsIndex