PageRenderTime 49ms CodeModel.GetById 39ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/core/classes/intersection/intersection-docs.factor

http://github.com/abeaumont/factor
Unknown | 30 lines | 25 code | 5 blank | 0 comment | 0 complexity | 671f3e118ba3e8e7f51c3a26a48698a1 MD5 | raw file
 1USING: generic help.markup help.syntax kernel kernel.private
 2namespaces sequences words arrays help effects math
 3layouts classes.private classes compiler.units ;
 4IN: classes.intersection
 5
 6ARTICLE: "intersections" "Intersection classes"
 7"An object is an instance of a intersection class if it is an instance of all of its participants."
 8{ $subsections POSTPONE: INTERSECTION: }
 9{ $subsections define-intersection-class }
10"Intersection classes can be introspected:"
11{ $subsections participants }
12"The set of intersection classes is a class:"
13{ $subsections
14    intersection-class
15    intersection-class?
16}
17"Intersection classes are used to associate a method with objects which are simultaneously instances of multiple different classes, as well as to conveniently define predicates." ;
18
19ABOUT: "intersections"
20
21HELP: define-intersection-class
22{ $values { "class" class } { "participants" "a sequence of classes" } }
23{ $description "Defines a intersection class with specified participants. This is the run time equivalent of " { $link POSTPONE: INTERSECTION: } "." }
24{ $notes "This word must be called from inside " { $link with-compilation-unit } "." }
25{ $side-effects "class" } ;
26
27{ intersection-class define-intersection-class POSTPONE: INTERSECTION: } related-words
28
29HELP: intersection-class
30{ $class-description "The class of intersection classes." } ;