]> gitweb.factorcode.org Git - factor.git/blob - core/classes/union/union-docs.factor
Fix permission bits
[factor.git] / core / classes / union / union-docs.factor
1 USING: generic help.markup help.syntax kernel kernel.private
2 namespaces sequences words arrays layouts help effects math
3 layouts classes.private classes compiler.units ;
4 IN: classes.union
5
6 ARTICLE: "unions" "Union classes"
7 "An object is an instance of a union class if it is an instance of one of its members."
8 { $subsection POSTPONE: UNION: }
9 { $subsection define-union-class }
10 "Union classes can be introspected:"
11 { $subsection members }
12 "The set of union classes is a class:"
13 { $subsection union-class }
14 { $subsection union-class? } 
15 "Unions are used to define behavior shared between a fixed set of classes, as well as to conveniently define predicates."
16 { $see-also "mixins" "tuple-subclassing" } ;
17
18 ABOUT: "unions"
19
20 HELP: define-union-class
21 { $values { "class" class } { "members" "a sequence of classes" } }
22 { $description "Defines a union class with specified members. This is the run time equivalent of " { $link POSTPONE: UNION: } "." }
23 { $notes "This word must be called from inside " { $link with-compilation-unit } "." }
24 { $side-effects "class" } ;
25
26 { union-class define-union-class POSTPONE: UNION: } related-words
27
28 HELP: union-class
29 { $class-description "The class of union classes." } ;