]> gitweb.factorcode.org Git - factor.git/blob - basis/stack-checker/dependencies/dependencies-docs.factor
d80880ad705e0388f79e2cb43536a59286165e5f
[factor.git] / basis / stack-checker / dependencies / dependencies-docs.factor
1 USING: classes help.markup help.syntax ;
2 IN: stack-checker.dependencies
3
4 HELP: +conditional+
5 { $description "Word that indicates that the dependency is a conditional dependency." } ;
6
7 HELP: +effect+
8 { $description "Word that indicates that the dependency is an effect dependency." } ;
9
10 HELP: +definition+
11 { $description "Word that indicates that the dependency is a definition dependency. It is a dependency among two words in which one word depends on the definition of the another. For example, if two words are defined as " { $snippet ": o ( -- ) i ;" } " and " { $snippet ": i ( -- ) ; inline" } ", then 'o' has a definition dependency to 'i' because 'i' is inline. If the definition of 'i' changes 'o' must be recompiled." } ;
12
13 HELP: add-depends-on-class
14 { $values { "obj" classoid } }
15 { $description "Adds a " { $link +conditional+ } " dependency from the word to the classes mentioned in the classoid." } ;
16
17 HELP: conditional-dependencies
18 { $var-description "The current word's conditional dependency checks." } ;
19
20 HELP: dependencies
21 { $var-description "Words that the current quotation depends on." } ;
22
23 HELP: depends-on-class-predicate
24 { $class-description "Objectifies a dependency on a class predicate." } ;
25
26 HELP: depends-on-flushable
27 { $class-description "Conditional dependency on a " { $link \ flushable } " word. The dependency becomes unsatisfied if the word no longer is flushable." } ;
28
29 HELP: generic-dependencies
30 { $var-description "Generic words that the current quotation depends on." } ;
31
32 ARTICLE: "stack-checker.dependencies" "Definition Dependency Management"
33 "This vocab manages dependency data during stack checking of words. All dependencies are divided into three types representing how words can depend on other words:"
34 { $subsections
35   +definition+
36   +effect+
37   +conditional+
38 }
39 "The type of the dependency determines when a word that depends on another word that is recompiled itself has to be recompiled. For example if word a has a " { $link +definition+ } " dependency on word b, and b's definition is changed, then a must be recompiled. Another dependency type is " { $link +effect+ } " which means that word depends on the stack effect of another word. It is a weaker form of dependency than +definition+. A words definition can change without its stack effect changing, but it it's stack effect is changing it implies that its definition is also changed."
40 $nl
41 "The third dependency type, +conditional+ encodes a conditional dependency between a word and other word which is usually a class. A condition object, kept in the word property \"dependency-checks\" evaluates if the condition is satisfied or not. If it isn't satisfied, then the word is recompiled. The types of condition objects are:"
42 { $subsections
43   depends-on-class-predicate
44   depends-on-final
45   depends-on-flushable
46   depends-on-instance-predicate
47   depends-on-method
48   depends-on-next-method
49   depends-on-tuple-layout
50 }
51 "The main benefit of using these condition checks is to ensure that if a word is changed, it doesn't cause 'cascading' recompilations."
52 $nl
53 "During stack checking, state to build dependency data is kept in the following variables:"
54 { $subsections
55   conditional-dependencies
56   dependencies
57   generic-dependencies
58 }
59 "Words for adding various types of dependencies:"
60 { $subsections
61   add-depends-on-c-type
62   add-depends-on-class
63   add-depends-on-class-predicate
64   add-depends-on-final
65   add-depends-on-flushable
66   add-depends-on-generic
67   add-depends-on-instance-predicate
68   add-depends-on-method
69   add-depends-on-next-method
70   add-depends-on-tuple-layout
71 } ;
72
73
74
75 ABOUT: "stack-checker.dependencies"