1 USING: help.markup help.syntax kernel ;
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." } ;
8 { $values { "box" box } }
9 { $description "Creates a new empty box." } ;
12 { $values { "value" object } { "box" box } }
13 { $description "Stores a value into a box." }
14 { $errors "Throws an error if the box is full." } ;
17 { $values { "box" box } { "value" "the value of the box" } }
18 { $description "Removes a value from a box." }
19 { $errors "Throws an error if the box is empty." } ;
22 { $values { "box" box } { "value/f" "the value of the box or " { $link f } } { "?" boolean } }
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" } "." } ;
25 ARTICLE: "boxes" "Boxes"
26 "A " { $emphasis "box" } " is a container which can either be empty or hold a single value."
28 "Creating an empty box:"
29 { $subsections <box> }
30 "Storing a value and removing a value from a box:"
35 "Safely removing a value:"
37 "Testing if a box is full can be done by reading the " { $snippet "occupied" } " slot." ;