Builtin Functions #
exit(INTEGER) #
Terminates the program with the given exit code.
π > exit(1)
exit status 1
raise(INTEGER, STRING) #
Terminates the program with the given exit code and prints the error message.
π > raise(1, "broken")
π₯ RocketLang raised an error: "broken"
exit status 1
puts(STRING|ARRAY|HASH|BOOLEAN|INTEGER|NULL|FILE) #
Prints the string representation of the given object to STDOUT.
π > puts("test")
"test"
π > puts([1,2,3])
[1, 2, 3]
π > puts(["test",true,3])
["test", true, 3]
open(STRING, STRING, STRING) #
Returns FILE
Opens a file pointer to the file at the path of argument one with the mode of (optional) argument two and a file permission as optional argument three.
π > open("main.go", "r", "0644")
=> <file:main.go>
Available file modes are r
, w
, wa
, rw
and rwa
,