For more information including compatibility, examples and test cases, see https://github.com/petercrlane/r7rslibs
0.1. Dynamic: (import (slib dynamic))
Provides a kind of namevalue store, which can be accessed globally. (This is essentially the same as R7RS parameters, with a different syntax.)
makedynamic
creates a dynamic object wrapping a given object.
dynamic?
returns true only if the given object is a dynamic.
dynamicref
returns the value of a given dynamic object.
dynamicset!
changes the value of the given dynamic object.
callwithdynamicbinding
temporarily rebinds a given dynamic
object to a new value within the given procedure.
(let ((x (makedynamic 'a)) ; <1> (y (makedynamic 'b))) (dynamic? x) ; <2> (eq? 'a (dynamicref x)) ; <3> (eq? 'b (dynamicref y)) (dynamicset! x 'c) ; <4> (callwithdynamicbinding x 'd ; <5> (lambda () (eq? 'd (dynamicref x)))) (eq? 'c (dynamicref x))) ; <6>

Names
x
as the dynamic object with value'a

Returns
#t
asx
is a dynamic object 
Retrieves the value of the given dynamic object, and checks it is correct

Changes the value of the given dynamic object

Within the
lambda
x
is now bound to'd

and
x
reverts to holding'c
after the call