Operator

interface Operator

A pure function from values to a value.

Functions

alternativeTypes
Link copied to clipboard
open fun alternativeTypes(): List<FunctionType>

In lieu of polymorphic types, have an optional list of alternative types to check against.

apply
Link copied to clipboard
abstract fun apply(arguments: List<Value>): Value

Computes the result of applying this operator to arguments.

toDocument
Link copied to clipboard
abstract fun toDocument(arguments: List<PrettyPrintable>): Document

Shows this operator applied to arguments.

Properties

associativity
Link copied to clipboard
abstract val associativity: Associativity

Determines the grouping of consecutive operators that have the same precedence.

precedence
Link copied to clipboard
abstract val precedence: Precedence

Determines the order of this operator with respect to (a subset of) other operators. Operators with higher precedence bind tighter than operators with lower precedence (for example, multiplication has higher precedence than addition).

type
Link copied to clipboard
abstract val type: FunctionType

The type of this operator.

Inheritors

PrefixOperator
Link copied to clipboard
InfixOperator
Link copied to clipboard
PostfixOperator
Link copied to clipboard
ClosedOperator
Link copied to clipboard
UnaryOperator
Link copied to clipboard
BinaryOperator
Link copied to clipboard

Extensions

arity
Link copied to clipboard
val Operator.arity: Int

The number of arguments this operator takes.

bindsTighterThan
Link copied to clipboard
fun Operator.bindsTighterThan(other: Operator): Boolean

Returns true when this operator has precedence higher than or equal to other.