core.ql

core.ql
Contents of the file.

Function Overview

Function Description
native fun print(obj) Prints a string representation of the given object to the console, followed by a newline character.
native fun readLine() Reads a line of input from the console.
fun printf(obj, formatParams) Prints a given string to the console, followed by a newline character. The string is formatted with string.format using the parameters provided.
native fun getEnv(name) Gets the environment variable of a given name. This will return a string, or throw an error if it can't be found.
fun getEnv(name, default) Gets the environment variable of a given name. If the value is not found, a default value is returned.
native fun hasEnv(name) Checks if an environment variable is set.
native fun currentTimeMillis() Gets the current time in milliseconds
native fun exit(code) Exits the program with the given exit code.

Functions

native fun print(obj) link

Prints a string representation of the given object to the console, followed by a newline character.

Params
obj

The object to print, of any type.

native fun readLine() link

Reads a line of input from the console.

Returns

The line of input read from the console

fun printf(obj, formatParams) link

Prints a given string to the console, followed by a newline character. The string is formatted with string.format using the parameters provided.

Params
obj

The object to print, of any type.

native fun getEnv(name) link

Gets the environment variable of a given name. This will return a string, or throw an error if it can't be found.

Params
name ( string )

The name of the environment variable to get

Returns

The value of the environment variable

fun getEnv(name, default) link

Gets the environment variable of a given name. If the value is not found, a default value is returned.

Params
name ( string )

The name of the environment variable to get

defaultValue ( string )

The default value to return if the environment variable is not found

Returns

The value of the environment variable

native fun hasEnv(name) link

Checks if an environment variable is set.

Params
name ( string )

The name of the environment variable to check for

Returns boolean

true if the environment variable is set, false if otherwise

native fun currentTimeMillis() link

Gets the current time in milliseconds

Returns int

The current time in milliseconds

native fun exit(code) link

Exits the program with the given exit code.

Params
code ( int )

The exit code to exit with