Macro Fluid-Bind

Part of:

package metabang.bind
( fluid-bind (&rest bindings) &body < body > )

Fluid-bind is an extension of bind that handles setting and resetting places. For example, suppose that an object of class foo has a slot named bar whose value is currently 3. The following code would evaluate the inner body with bar bound to 17 and restore it when the inner body is exited.

(fluid-bind (((bar foo) 17))
(print (bar foo)))
(print (bar foo))
==> (prints 17, then 3)

This is similar to dynamic-binding but much less robust.