]> gitweb.factorcode.org Git - factor.git/blob - core/classes/intersection/intersection-docs.factor
merge project-euler.factor
[factor.git] / core / classes / intersection / intersection-docs.factor
1 USING: generic help.markup help.syntax kernel kernel.private
2 namespaces sequences words arrays help effects math
3 layouts classes.private classes compiler.units ;
4 IN: classes.intersection
5
6 ARTICLE: "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
19 ABOUT: "intersections"
20
21 HELP: 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
29 HELP: intersection-class
30 { $class-description "The class of intersection classes." } ;