Library class abstract

Abstract base class for organizing standard library functions.

Extend this class to register a reusable namespaced or global library with a LuaRuntime. LuaLike's built-in string, table, math, and debug libraries all implement this interface.

A library with a non-empty name is installed as a table and can be loaded lazily through LibraryRegistry. A library with an empty name injects its functions directly into the global environment, which is how the base library is modeled.

Constructors

Library()

Properties

hashCode int
The hash code for this object.
no setterinherited
interpreter LuaRuntime?
The runtime currently initializing this library.
getter/setter pair
name String
The public Lua name for this library, such as string or math.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getMetamethods(LuaRuntime interpreter) Map<String, Function>?
Optional metamethods attached to the exported library table.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerFunctions(LibraryRegistrationContext context) → void
Register all functions for this library.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited