std

assert

fun assert(bool condition, str? message = null) > void 

If condition is false print message and exit program

  • message: message printed if condition is false

print

fun print(str value) > void 

Prints value on stdout

  • value: value to print

parseInt

fun parseInt(str string) > int? 

Parse number, returns null if string does not represent a number

  • string: string to parse

Returns: integer parsed or null

parseFloat

fun parseFloat(str string) > float? 

Parse number, returns null if string does not represent a number

  • string: string to parse

Returns: float parsed or null

toInt

fun toInt(float n) > int 

Cast float to a integer value

  • n: value to cast

Returns: casted value

toFloat

fun toFloat(int n) > float 

Cast integer to a float value

  • n: value to cast

Returns: casted value

toUd

fun toUd(any n) > ud

Cast number to a userdata

  • n: value to cast

parseUd

fun parseUd(str string) > ud?

Parse ud, returns null if string does not represent a ud (u64)

  • string: string to parse

Returns: ud parsed or null

Returns: casted value

char

fun char(int byte) > str 

Return ascii char for given byte

random

fun random(int? min = null, int? max = null) > int

Return evenly distributed random number between min and max

  • min: Minimum value, if omitted 0
  • max: Maximum value, if omitted min + 1

Returns: Random value

currentFiber

fun currentFiber() > fib<any, any?>

Returns: the current fiber

panic

fun panic(str message) > void

Print message and exit program

Last Updated:
Contributors: Benoit Giannangeli, hshq