website is under construction
Standard Library

Zaid

Methods

zaid.abort()

Creates a new runtime error and outputs the specified message. If the passed value is null no runtime error is generated.

zaid.abort("A critical error was encountered. Aborting.")

// expected output: A critical error was encountered. Aborting.

zaid.execute()

Executes Zaid code represented as a string. The string representation can include variables and properties of existing objects.

print(zaid.execute('2 + 2'))

// expected output: 4

zaid.extend()

Registers and executes a plugin compiled through Go, allowing the ability to dynamically extend Zaid with new native functionality. Plugins must be compiled against both the exact version of Zaid, and the version of Go used to compile Zaid.

Zaid VersionGo Version
1.0-beta.11.17.5

To compile a plugin with Go, use the -buildmode=plugin build flag:

$ go build -buildmode=plugin -o example.so main.go
zaid.extend('./example.so')

zaid.identifiers()

Returns a list of all identifieris within the current scope.

zaid.identifiers()

Properties

zaid.version

Returns the current version of Zaid.

zaid.version