Types

Construct a new Types instance with the specified parent. Use PrimitiveTypeDescriptor for the new type's descriptor.

Parameters

parent

The new type's parent, or null if the type has no parent.

typeTag

The TypeTag that labels the kind of value that o is.

instanceTag

The TypeTag that this type's actual instances will have.

Entries

Link copied to clipboard

The most general type of the type lattice, also written ⊤ and pronounced "top". All types are subtypes of this, and all objects are instances of it. However, this top type has an additional role: No variable or argument may be of this type, so the only thing that can be done with the result of a function call of type ⊤ is to implicitly discard it. This is a precise way of making the traditional distinction between functions and procedures. In fact, Avail requires all statements except the last one in a block to be of type ⊤, to ensure that functions are not accidentally used as procedures – and to ensure that the reader of the code knows it.

Link copied to clipboard

This is the second-most general type in Avail's type lattice. It is the only direct descendant of top (⊤), and all types except ⊤ are subtypes of it. Like ⊤, all Avail objects are instances of ANY. Technically there is also a nil, but that is only used internally by the Avail machinery (e.g., the value of an unassigned variable) and can never be manipulated by an Avail program.

Link copied to clipboard

This is the kind of all non-types.

Link copied to clipboard

This is the kind of all atoms. Atoms have fiat identity and their corresponding type structure is trivial.

Link copied to clipboard

This is the kind of all characters, as defined by the Unicode standard. Note that all characters in the supplementary multilingual planes are explicitly supported.

Link copied to clipboard

Number is the generalization of all numeric types, which includes float, double, and the integer types (which can contain both integers and the signed integral infinities),

Link copied to clipboard

The type of all double-precision floating point numbers. This includes the double precision positive and negative infinities and Not-a-Number.

Link copied to clipboard

The type of all single-precision floating point numbers. This includes the single precision positive and negative infinities and Not-a-Number.

Link copied to clipboard

All lexers are of this kind.

Link copied to clipboard

All methods are of this kind.

Link copied to clipboard

This is the kind of all message bundles, which are used during parsing of Avail code.

Link copied to clipboard

This is the kind of all definition parsing plans, which are used during parsing of Avail code.

Link copied to clipboard

The type of macro definitions.

Link copied to clipboard

This is the kind of all parsing-plans-in-progress, which are used during parsing of Avail code.

Link copied to clipboard

This is the kind of all message bundle trees, which are lazily expanded during parallel parsing of Avail expressions. They collapse together the cost of parsing method or macro invocations that start with the same tokens and arguments.

Link copied to clipboard

Tokens all have the same kind, except for literal tokens, which are parametrically typed by the type of value they contain. They are produced by a LexicalScanner and are consumed by the AvailCompiler.

Link copied to clipboard

The general kind of method signatures.

Link copied to clipboard

The specific kind of a definition which is an abstract declaration of a method.

Link copied to clipboard

The specific kind of definition which is a forward declaration. Such declarations must be resolved by the end of the module in which they occur.

Link copied to clipboard

The specific kind of definition which is an actual method function, by far the most common case.

Link copied to clipboard

Modules are maintained mostly automatically by Avail's runtime environment. Modules are not currently visible to the Avail programmer, but there may still be a need for modules to be placed in sets and maps maintained by the runtime, so the type story has to at least be consistent.

Link copied to clipboard

A POJO is a Plain Old Java Object. Avail is able to interface to arbitrary Java code via its implementation of POJOs. POJOs contain (and conform to) their own POJO types, but that requires a separate concept of raw POJOs. Avail code only works with the typed POJOs, but the Avail machinery has to be able to use the raw POJOs, placing them in sets and doing other things that occasionally require their kind to be extracted.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

An array of A_Types, where the entries correspond to ordinals of other Types, and hold the intersection of that type and the current type.

Link copied to clipboard
Link copied to clipboard
lateinit var o: AvailObject

Create the A_Type associated with this Types entry.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A boolean array where the entries correspond to ordinals of other Types. They are true precisely when the type with that ordinal is a supertype of the current type.

Link copied to clipboard
Link copied to clipboard

An array of A_Types, where the entries correspond to ordinals of other Types, and hold the unions of that type and the current type.

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.