From 2f5baac5a52a17201e8959a695e2da62942b2100 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Fri, 30 Sep 2016 17:09:00 -0400 Subject: [PATCH] Added docs --- docs/api/srfi/111.md | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/docs/api/srfi/111.md b/docs/api/srfi/111.md index 512e7f6b..bd19fb6b 100644 --- a/docs/api/srfi/111.md +++ b/docs/api/srfi/111.md @@ -1,21 +1,24 @@ # SRFI 111 - Boxes -The `(srfi 111)` library ... +The `(srfi 111)` library defines boxes, a container for an object of any Scheme type, including another box. Boxes are normally used as minimal mutable storage, and can inject a controlled amount of mutability into an otherwise immutable data structure (or one that is conventionally treated as immutable). See the [SRFI document](http://srfi.schemers.org/srfi-111/srfi-111.html) for more information. -##- [`and-let*`](#and-let) -## -###and-let* -## (and-let* (claws) body -## -## claws ::= '() | (cons claw claws) -## claw ::= (variable expression) | (expression) | -## bound-variable -## -##- The `claws` are evaluated in the strict left-to-right order -##- For each `claw`, the `expression` part is evaluated first (or `bound-variable` is looked up) -##- If the result is #f, `and-let*` immediately returns #f -##- Otherwise, if the `claw` is of the form `(variable expression)` the `expression`'s value is bound to a freshly made `variable` -##- The `variable` is available for the rest of the `claws` , and the `body` -##- As usual, all `variable`s must be unique (like in `let*`) +- [`box`] (#box) +- [`box?`] (#box-1) +- [`unbox`] (#unbox) +- [`set-box!`](#set-box) + +#box + (box value) +Constructor. Returns a newly allocated box initialized to value. +#box? + (box? object) +Predicate. Returns #t if object is a box, and #f otherwise. +#unbox + (unbox box) +Accessor. Returns the current value of box. +#set-box! + (set-box! box value) +Mutator. Changes box to hold value. +