On this page:
box?
box
box-immutable
unbox
set-box!
Version: 4.1

3.12 Boxes

Boxes in Guide: PLT Scheme introduces boxes.

A box is like a single-element vector, normally used as minimal mutable storage.

(box? v)  boolean?

  v : any/c

Returns #t if v is a box, #f otherwise.

(box v)  box?

  v : any/c

Returns a new mutable box that contains v.

(box-immutable v)  (and/c box? immutable?)

  v : any/c

Returns a new immutable box that contains v.

(unbox box)  any/c

  box : box?

Returns the content of box.

For any v, (unbox (box v)) returns v.

(set-box! box v)  void?

  box : (and/c box? (not/c immutable?))

  v : any/c

Sets the content of box to v.