factor/core/classes/union/union-docs.factor

34 lines
1.1 KiB
Factor
Raw Normal View History

2007-09-20 18:09:08 -04:00
USING: generic help.markup help.syntax kernel kernel.private
2009-05-16 11:45:17 -04:00
namespaces sequences words arrays help effects math
classes.private classes compiler.units ;
2007-09-20 18:09:08 -04:00
IN: classes.union
ARTICLE: "unions" "Union classes"
2008-05-10 19:09:05 -04:00
"An object is an instance of a union class if it is an instance of one of its members."
{ $subsections
POSTPONE: UNION:
define-union-class
}
2007-09-20 18:09:08 -04:00
"Union classes can be introspected:"
{ $subsections members }
2007-09-20 18:09:08 -04:00
"The set of union classes is a class:"
{ $subsections
union-class
union-class?
}
2008-05-10 19:09:05 -04:00
"Unions are used to define behavior shared between a fixed set of classes, as well as to conveniently define predicates."
2008-04-03 22:29:49 -04:00
{ $see-also "mixins" "tuple-subclassing" } ;
2007-09-20 18:09:08 -04:00
ABOUT: "unions"
HELP: define-union-class
{ $values { "class" class } { "members" "a sequence of classes" } }
2007-12-30 16:09:21 -05:00
{ $description "Defines a union class with specified members. This is the run time equivalent of " { $link POSTPONE: UNION: } "." }
2007-12-30 15:08:48 -05:00
{ $notes "This word must be called from inside " { $link with-compilation-unit } "." }
{ $side-effects "class" } ;
2007-09-20 18:09:08 -04:00
{ union-class define-union-class POSTPONE: UNION: } related-words
HELP: union-class
{ $class-description "The class of union classes." } ;