The Avail Programming Language

Definition

A phrase specifying a new constant's name and its permanent value. This value is given in the form of an expression that evaluates to any type other than top or bottom. The expression may be a literal, in which case the type of the constant's type becomes the literal's type. Otherwise, the type of the constant will depend on its definition context: in a top-level statement within a module, the value expression will produce an object, so the constant's type will be the specific instance type of the object; within a function definition, a constant's type will be the static type of the expression. (A definition statement, like any statement, ends in a semicolon.)

Grammar: CONSTNAME ::= EXPRESSION
Example: cubeSideCount ::= 6

Or, the addition of a new implementation, grammatical restriction, or semantic restriction to a method.

Grammar: NEWTHING METHODNAME is BLOCK

See also: In-depth looks at definitions, method definitions, abstract definitions, forward definitions, and macro definitions.