Pyr8 User's Manual

« Thread API | The Database API »

The Utilities API

The utilities are important functions for which no other sensible object API seems reasonable.

The Utils Object

Methods

cap(): capability<utils>
Returns a C++-backed capability object for this utils object.
print(message: string): void
Prints a message to stdout.
printerr(message: string): void
Prints a message to stderr.
exit(code: int32, opt_return_val: string, opt_error_msg: string): void
Terminates execution of the current thread as soon as possible; note that execution will proceed past a call to exit, so if the program must end at the call site, use an infinite loop like for(;;){}. If provided code specifies the exit code for the thread, opt_return_val is the thread’s return value, and opt_error_msg provides the error message.

When the standard library has been loaded, the Utils delegate class does not have the cap method, and the exit() method provides the infinite loop itself.

« Thread API | The Database API »