KthFunction

Function token to be included in a KthModule or KthContext and used in an expression.

A function takes a fixed amount of arguments and returns a value.

Functions can be built using the helper functions createFunction and asFunction.

Properties

Link copied to clipboard
abstract val argCount: Int

The number of arguments of the function

Link copied to clipboard
abstract val key: String

The key of the token. Used to parse the token in an expression.

Functions

Link copied to clipboard
abstract operator fun invoke(vararg args: Double): Double

Applies the function with the specified arguments and returns its result.