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

7.4 with-stable-pointer

— Macro: with-stable-pointer
     (with-stable-pointer (ptr expr) &body body)
A variable that will be bound to the stable pointer
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.


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