1 USING: help.markup help.syntax kernel ;
\r
5 { $class-description "A data type holding a single value in the " { $snippet "value" } " slot. The " { $snippet "occupied" } " slot indicates if the value is set." } ;
\r
8 { $values { "box" box } }
\r
9 { $description "Creates a new empty box." } ;
\r
12 { $values { "value" object } { "box" box } }
\r
13 { $description "Stores a value into a box." }
\r
14 { $errors "Throws an error if the box is full." } ;
\r
17 { $values { "box" box } { "value" "the value of the box" } }
\r
18 { $description "Removes a value from a box." }
\r
19 { $errors "Throws an error if the box is empty." } ;
\r
22 { $values { "box" box } { "value/f" "the value of the box or " { $link f } } { "?" "a boolean" } }
\r
23 { $description "If the box is full, removes the value from the box and pushes " { $link t } ". If the box is empty pushes " { $snippet "f f" } "." } ;
\r
25 ARTICLE: "boxes" "Boxes"
\r
26 "A " { $emphasis "box" } " is a container which can either be empty or hold a single value."
\r
28 "Creating an empty box:"
\r
29 { $subsection <box> }
\r
30 "Storing a value and removing a value from a box:"
\r
31 { $subsection >box }
\r
32 { $subsection box> }
\r
33 "Safely removing a value:"
\r
34 { $subsection ?box }
\r
35 "Testing if a box is full can be done by reading the " { $snippet "occupied" } " slot." ;
\r