Package avail.dispatch

Types

Link copied to clipboard
sealed class DecisionStep<Element : A_BasicObject, Result : A_BasicObject>

This abstraction represents a mechanism for achieving a quantum of progress toward looking up which method definition to invoke, or some similar usage.

Link copied to clipboard
class ExtractMetaInstanceDecisionStep<Element : A_BasicObject, Result : A_BasicObject>(argumentPositionToTest: Int, childNode: InternalLookupTree<Element, Result>) : DecisionStep<Element, Result>

This is a DecisionStep which takes a metatype from an argument or extra, and extracts its instance, a type, for subsequent dispatching. This new value should have a useful subsequent dispatching power, otherwise there would be no point in extracting it.

Link copied to clipboard
class ExtractObjectFieldDecisionStep<Element : A_BasicObject, Result : A_BasicObject>(    argumentPositionToTest: Int,     field: A_Atom,     fieldIndex: Int,     childNode: InternalLookupTree<Element, Result>) : DecisionStep<Element, Result>

This is a DecisionStep which extracts one field from an argument or extra, and adds it to the list of extras, for subsequent dispatching. This new value should have a useful subsequent dispatching power, otherwise there would be no point in extracting it.

Link copied to clipboard
class ExtractObjectTypeFieldDecisionStep<Element : A_BasicObject, Result : A_BasicObject>(    argumentPositionToTest: Int,     field: A_Atom,     fieldIndex: Int,     childNode: InternalLookupTree<Element, Result>) : DecisionStep<Element, Result>

This is a DecisionStep which extracts one field type from an argument or extra, which must be passed an object type having that field (and a known variant, or at least a known fieldIndex). It adds the extracted field type to the list of extras, for subsequent dispatching. This new value should have a useful subsequent dispatching power, otherwise there would be no point in extracting it.

Link copied to clipboard
class ExtractPhraseTypeDecisionStep<Element : A_BasicObject, Result : A_BasicObject>(argumentPositionToTest: Int, childNode: InternalLookupTree<Element, Result>) : DecisionStep<Element, Result>

This is a DecisionStep which takes a phrase from an argument or extra, and adds it to the list of extras, for subsequent dispatching. This new value should have a useful subsequent dispatching power, otherwise there would be no point in extracting it.

Link copied to clipboard

A LookupTree representing an incomplete search. To further the search, its decisionStep performs some sort of dynamic test, producing the next subtree to visit.

Link copied to clipboard
class LeafLookupTree<Element : A_BasicObject, Result : A_BasicObject> : LookupTree<Element, Result>

A LookupTree representing a solution.

Link copied to clipboard
class LookupStatistics(baseName: String, report: StatisticReport)

A helper class holding a pair of Statistics, one by the amount of time for each dynamic lookup, and one by the depth traveled within the lookup tree.

Link copied to clipboard
abstract class LookupTree<Element : A_BasicObject, Result : A_BasicObject>

LookupTree is used to look up method definitions by argument types, although it's more general than that.

Link copied to clipboard
abstract class LookupTreeAdaptor<Element : A_BasicObject, Result : A_BasicObject, Memento>

LookupTreeAdaptor is instantiated to construct and interpret a family of type-dispatch trees.

Link copied to clipboard
class ObjectLayoutVariantDecisionStep<Element : A_BasicObject, Result : A_BasicObject>(    thisInternalLookupTree: InternalLookupTree<Element, Result>,     argumentPositionToTest: Int,     signatureExtrasExtractor: (Element) -> Pair<A_Type?, List<A_Type>>,     variantToElements: Map<ObjectLayoutVariant, List<Element>>,     alreadyVariantTestedArgumentsForChildren: A_Number) : DecisionStep<Element, Result>

This is a DecisionStep which dispatches to subtrees by looking up the argument's ObjectLayoutVariant. It can only be used when the argument has been constrained to an object.

Link copied to clipboard
class ObjectTypeLayoutVariantDecisionStep<Element : A_BasicObject, Result : A_BasicObject>(    thisInternalLookupTree: InternalLookupTree<Element, Result>,     argumentPositionToTest: Int,     signatureExtrasExtractor: (Element) -> Pair<A_Type?, List<A_Type>>,     variantToElements: Map<ObjectLayoutVariant, List<Element>>,     alreadyVariantTestedArgumentsForChildren: A_Number) : DecisionStep<Element, Result>

This is a DecisionStep which dispatches to subtrees by looking up the ObjectLayoutVariant of the argument, which has already been proven to be an object type.

Link copied to clipboard
class TestArgumentDecisionStep<Element : A_BasicObject, Result : A_BasicObject>(    argumentTypeToTest: A_Type,     argumentPositionToTest: Int,     ifCheckHolds: LookupTree<Element, Result>,     ifCheckFails: LookupTree<Element, Result>) : DecisionStep<Element, Result>

This is a DecisionStep which tests a particular argument position against some constant type.

Link copied to clipboard
class TestForConstantsDecisionStep<Element : A_BasicObject, Result : A_BasicObject>(    argumentPositionToTest: Int,     valueToSubtree: Map<A_BasicObject, LookupTree<Element, Result>>,     noMatchSubtree: LookupTree<Element, Result>,     bypassForTypeLookup: LookupTree<Element, Result>) : DecisionStep<Element, Result>

This is a DecisionStep which dispatches to subtrees by looking up the exact value in a particular argument position. Since Avail objects have permanent hash values (over the lifetime of an OS process), we can use the hash value for an initial lookup, followed by a full check that it's the right object and not just a hash collision.

Link copied to clipboard
class TestForEnumerationOfNontypeDecisionStep<Element : A_BasicObject, Result : A_BasicObject>(    argumentPositionToTest: Int,     instanceTypeToSubtree: Map<A_Type, LookupTree<Element, Result>>,     fallThrough: LookupTree<Element, Result>) : DecisionStep<Element, Result>

This is a DecisionStep which can efficiently handle instance types (singular enumerations over non-types), as indicated in the signature of the Elements. It handles all other values by dispatching to a fallThrough subtree.

Link copied to clipboard
enum TypeComparison : Enum<TypeComparison>

Answer the relationship between two signatures, the argument tuple types of function types representing (1) a criterion to test, and (2) a definition's signature to be classified.

Link copied to clipboard
class TypeTagDecisionStep<Element : A_BasicObject, Result : A_BasicObject>(argumentPositionToTest: Int, tagToSubtree: Map<TypeTag, LookupTree<Element, Result>>) : DecisionStep<Element, Result>

This is a DecisionStep which dispatches to subtrees by looking up the TypeTag for a particular argument position. Narrowing the effective TypeRestriction on the argument in this way can quickly reduce the number of applicable elements in the subtrees, which may also promote other techniques, such as dispatching on an object or object type's ObjectLayoutVariant, or extracting a covariant or contravariant parameter into a separate argument.