Previous: stable-pointer-value, Up: Stable pointers


4.7.4 with-stable-pointer

— Macro: with-stable-pointer
     (with-stable-pointer (ptr expr) &body body)
ptr
A variable that will be bound to the stable pointer
expr
An expression that will be evaluated once and its value will be bound to stable pointer's value

Executes the body with the ptr variable being bound to a stable pointer whose value is determined by expr.

Example:

     (with-stable-pointer (ptr (lambda (x) (+ x 10)))
       (print (stable-pointer-value ptr)))
     ;;Prints:
     #<FUNCTION (LAMBDA (X)) {1004807E79}>