Go to the previous, next section.
Cells are data structures similar to pairs except that they have only one element. They are useful for managing state.
Returns #t
if object is a cell; otherwise returns
#f
.
Returns a newly allocated cell whose contents is object.
procedure+: cell-contents cell
Returns the current contents of cell.
procedure+: set-cell-contents! cell object
Alters the contents of cell to be object. Returns an unspecified value.
procedure+: bind-cell-contents! cell object thunk
Alters the contents of cell to be object, calls thunk with no arguments, then restores the original contents of cell and returns the value returned by thunk. This is completely equivalent to dynamic binding of a variable, including the behavior when continuations are used (see section Dynamic Binding).
Go to the previous, next section.