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

http://github.com/abeaumont/factor · Factor · 30 lines · 25 code · 5 blank · 0 comment · 0 complexity · 671f3e118ba3e8e7f51c3a26a48698a1 MD5 · raw file

  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. ARTICLE: "intersections" "Intersection classes"
  6. "An object is an instance of a intersection class if it is an instance of all of its participants."
  7. { $subsections POSTPONE: INTERSECTION: }
  8. { $subsections define-intersection-class }
  9. "Intersection classes can be introspected:"
  10. { $subsections participants }
  11. "The set of intersection classes is a class:"
  12. { $subsections
  13. intersection-class
  14. intersection-class?
  15. }
  16. "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." ;
  17. ABOUT: "intersections"
  18. HELP: define-intersection-class
  19. { $values { "class" class } { "participants" "a sequence of classes" } }
  20. { $description "Defines a intersection class with specified participants. This is the run time equivalent of " { $link POSTPONE: INTERSECTION: } "." }
  21. { $notes "This word must be called from inside " { $link with-compilation-unit } "." }
  22. { $side-effects "class" } ;
  23. { intersection-class define-intersection-class POSTPONE: INTERSECTION: } related-words
  24. HELP: intersection-class
  25. { $class-description "The class of intersection classes." } ;