Package-level declarations

Types

Link copied to clipboard
data class Arity(val required: Int, val requiresSelf: Boolean = false, val isVarargs: Boolean = false)

The argument information for a CallableValue.

Link copied to clipboard
interface CallableValue : Value

A Value that can be called.

Link copied to clipboard
open class MetisRuntimeException(val type: String, actualMessage: String, companionData: Value.Table = Value.Table(), cause: Throwable? = null) : MetisException, Value

A runtime exception that can be thrown from Metis code.

Link copied to clipboard
class State(val parentState: State? = null)

Represents the state of a Metis virtual machine. This is the class that is used to run Metis code.

Link copied to clipboard
interface Value

A value in the Metis runtime.

Functions

Link copied to clipboard
inline fun <T> Value.asObj(): T

If this is a Value.Native, returns the native object, otherwise throws an error.

Link copied to clipboard

Converts this value to a kotlin.Boolean, or throws an error if it cannot be converted.

Link copied to clipboard
inline fun buildTable(init: (MutableMap<String, Value>) -> Unit): Value.Table

Builds a Value.Table

Link copied to clipboard

Converts this value to a Value.Bytes, or throws an error if it cannot be converted.

Link copied to clipboard
inline fun <T : Value> Value.convertTo(): T

Converts this value to a T, or throws an error if it cannot be converted.

Link copied to clipboard

Converts this value to a Double, or throws an error if it cannot be converted.

Link copied to clipboard
operator fun MutableMap<Value, Value>.get(key: String): Value?
Link copied to clipboard

Converts this value to a Int, or throws an error if it cannot be converted.

Link copied to clipboard

Converts this value to a Value.List, or throws an error if it cannot be converted.

Link copied to clipboard
fun Value.lookUp(key: Value): Value?

Look up a value in this value, possibly using the metatable.

Link copied to clipboard
fun Value.lookUpHierarchy(vararg keys: String): Value?

Look up a successive sequence of strings in this value.

Link copied to clipboard

If this value is null, return Value.Null, otherwise return this value.

Link copied to clipboard
fun Value.set(key: Value, value: Value): Boolean

Sets a value in this value, possibly using the metatable.

operator fun MutableMap<Value, Value>.set(key: String, value: Value)
Link copied to clipboard
fun Value.setOrError(key: Value, value: Value)

Sets a value in this value, or throws an error if it cannot be set.

Link copied to clipboard

Converts this value to a String, or throws an error if it cannot be converted.

Link copied to clipboard

Converts this value to a Value.Table, or throws an error if it cannot be converted.

Link copied to clipboard
fun typeToName(clazz: KClass<out Value>): String

Converts a Value's class to an end user-friendly name.