Module sys

Interpreter and system environment access.

Functions

define exit(status: Byte)

Exit the interpreter with status exit code.

This function will always exit the interpreter, because it does NOT raise an exception to exit.

Following an exit, the interpreter will yield control to the embedder. The interpreter will block subsequent attempts to load content to prevent further usage. Regardless of exit code, the interpreter will return to the embedder successfully (no error is recorded).

The interpreter does not exit on behalf of the embedder. Instead, the interpreter provides functionality through the api to retrieve a suitable exit code.

define exit_failure

Convenience function for calling sys.exit with EXIT_FAILURE.

define exit_success

Convenience function for calling sys.exit with EXIT_SUCCESS.

define getenv(name: String): Option[String]

Search the environment for name, returning either a Some with the contents, or None. Internally, this is a wrapper over C's getenv.

define recursion_limit: Integer

Return the current recursion limit.

define set_recursion_limit(limit: Integer)

Attempt to set limit as the maximum recursion limit.

Vars

var argv: List[String]

This contains arguments sent to the program through the command-line. If Lily was not invoked from the command-line (ex: mod_lily), then this is empty.