Package-level declarations
Types
A_ChunkDependable is an interface that specifies behavior specific to values on which chunks can depend. When those objects change in some way, dependent chunks must be invalidated. The rate of change of such objects is expected to be very low compared to the number of times the dependent chunks are invoked.
A_Definition is an interface that specifies the operations specific to definitions (of a method) in Avail. It's a sub-interface of A_BasicObject, the interface that defines the behavior that all AvailObjects are required to support.
A_GrammaticalRestriction is an interface that specifies the operations suitable for a grammatical restriction. It's a sub-interface of A_BasicObject, the interface that defines the behavior that all AvailObjects are required to support.
A_Macro is an interface that specifies how a send phrase that appears to invoke some method should be transformed to another phrase. It's a sub-interface of A_BasicObject, the interface that defines the behavior that all AvailObjects are required to support.
A_Method is an interface that specifies behavior specific to Avail methods that an AvailObject must implement.
A_SemanticRestriction is an interface that specifies the operations suitable for a semantic restriction. It's a sub-interface of A_BasicObject, the interface that defines the behavior that all AvailObjects are required to support.
A_Sendable is the common superinterface that subsumes A_Definition and A_Macro. It's the kind of thing for which an invocation site can be parsed.
A_Styler is an interface that specifies the operations specific to stylers of a method definition in Avail. It's a sub-interface of A_BasicObject, the interface that defines the behavior that all AvailObjects are required to support.
This is a specialization of DefinitionDescriptor that is an abstract declaration of an Avail method (i.e., no implementation).
DefinitionDescriptor is an abstraction for things placed into a method. They can be:
This is a forward declaration of a method. An actual method must be defined with the same signature before the end of the current module.
A GrammaticalRestrictionDescriptor grammatical restriction serves to exclude specific parses of nested method sends, thereby defining the negative space of a grammar. As it happens, this negative space is significantly more modular than traditional positive grammars, in which precedence between all operations is specified explicitly. Not only is the negative space scheme more modular, but the class of grammars specifiable this way is much more powerful.
Macros are extremely hygienic in Avail. They are defined almost exactly like ordinary multimethods. The first difference is which primitive is used to define a macro versus a method. The other difference is that instead of generating code at an occurrence to call a method (a call site), the macro body is immediately invoked, passing the phrases that occupy the corresponding argument positions in the method/macro name. The macro body will then do what it does and return a suitable replacement phrase.
An object instance of MethodDefinitionDescriptor represents a function in the collection of available functions for this method hierarchy.
A method maintains all A_Definitions that have the same name. At compile time a name is looked up and the corresponding method is stored as a literal in the object code for a call site. At runtime, the actual function is located within the method and then invoked. The methods also keep track of bidirectional dependencies, so that a change of membership (e.g., adding a method definition) causes an immediate invalidation of optimized level two code that depends on the previous membership.
A semantic restriction holds a function to invoke when compiling a potential call site of a method. The arguments' static types at the call site are passed to the function, and if successful it produces a result type used to further restrict the expected type at that call site. Instead, it may invoke P_RejectParsing to cause that call site to be rejected as a possible parse, supplying a message describing the nature of the rejection. The message will be shown to the user if no significant parsing beyond this point in the source file was possible. Raising an unhandled exception during execution of the semantic restriction will similarly be wrapped with a suitable error string and possibly a stack trace, leading to a parse rejection just as with the explicit rejection primitive.