This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home.

Source for wiki BoxesCowan version 6

author

cowan

comment


    

ipnr

173.13.139.236

name

BoxesCowan

readonly

0

text

== Boxes ==

This is a trivial module, providing objects with a single mutable state.  Several Schemes have something like it, sometimes called ''cells''.  Boxes are a disjoint type.

== Procedures ==

 * `box`: constructor
 * `box?`: predicate
 * `unbox`: accessor
 * `set-box!`: mutator

== Existing implementations ==

||Proposed||[http://docs.racket-lang.org/reference/boxes.html Racket]||[http://www.iro.umontreal.ca/~gambit/doc/gambit-c.html#index-boxes Gambit]||[http://sisc-scheme.org/manual/html/ch03.html#Boxing SISC]||[http://www.scheme.com/csug7/objects.html#g50 Chez]||[http://wiki.call-cc.org/eggref/4/box Chicken]||[http://web.mit.edu/scheme_v9.0.1/doc/mit-scheme-ref/Cells.html MIT]||[http://s48.org/1.1/manual/s48manual_42.html Scheme48/scsh]||
||box||box||box||box||box||make-box||make-cell||make-cell||
||box?||box?||box?||box?||box?||box-mutable?||cell?||cell?||
||unbox||unbox||unbox||unbox||unbox||box-ref||cell-contents||cell-ref||
||set-box{{{!}}}||set-box{{{!}}}||set-box{{{!}}}||set-box{{{!}}}||set-box{{{!}}}||box-set{{{!}}}||set-cell-contents{{{!}}}||cell-set{{{!}}}||

== Lexical syntax ==

Racket, Gambit, SISC, Chez, and Chicken all support `#&` to create a box initialized with the object represented by the following datum.

time

2013-03-12 02:44:15

version

6