Overview Clamps Packages CM Dictionary Clamps Dictionary Fomus
Next: with-svg-file , Previous: with-props , Up: W-Y , Home: Overview

Clamps Dictionary

with-shadowed-variable

Macro

(with-shadowed-variable (var) &rest body)

Shadow var in the local scope of body. var should be bound before entering with-shadowed-variable.

Arguments

var Symbol of variable to shadow
body Body for the scope of the shadowing.

Example

(defvar *myvar* 2) ; => *myvar*

(defun return-myvar ()
 *myvar*)

(with-shadowed-variable (*myvar*)
  (setf *myvar* 10)
  (return-myvar))

;; => 10

*myvar* ; => 2

Author: Orm Finnendahl

Created: 2025-02-18 Di 12:58

Validate