1 USING: classes help.markup help.syntax ;
2 IN: stack-checker.dependencies
5 { $description "Word that indicates that the dependency is a conditional dependency." } ;
8 { $description "Word that indicates that the dependency is an effect dependency." } ;
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." } ;
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." } ;
17 HELP: conditional-dependencies
18 { $var-description "The current word's conditional dependency checks." } ;
21 { $var-description "Words that the current quotation depends on." } ;
23 HELP: depends-on-class-predicate
24 { $class-description "Objectifies a dependency on a class predicate." } ;
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." } ;
29 HELP: generic-dependencies
30 { $var-description "Generic words that the current quotation depends on." } ;
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:"
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."
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:"
43 depends-on-class-predicate
46 depends-on-instance-predicate
48 depends-on-next-method
49 depends-on-tuple-layout
51 "The main benefit of using these condition checks is to ensure that if a word is changed, it doesn't cause 'cascading' recompilations."
53 "During stack checking, state to build dependency data is kept in the following variables:"
55 conditional-dependencies
59 "Words for adding various types of dependencies:"
63 add-depends-on-class-predicate
65 add-depends-on-flushable
66 add-depends-on-generic
67 add-depends-on-instance-predicate
69 add-depends-on-next-method
70 add-depends-on-tuple-layout
75 ABOUT: "stack-checker.dependencies"