Top

[exit]

docstring for 'exit' function:
------------
Exit program after the current instruction

(example)
def main = {
"ERROR! ..." print
1 exit
"other instructions..." print
}
/*
Output:
"ERROR! ..."
*** Exception: ExitFailure 1
*/
---------
def main = {
"other instructions..." print
0 exit
}
/*
Output:
"other instructions..."
*/

[args]

docstring for 'args' function:
------------
Get the program's command line arguments

(example)
def main = {
args print
}
/*
noc file.noc a b
Output:
["a", "b"]
-----
noc file.noc -- a b --arg c
["a" "b" "--arg" "c"]
*/

[catch]

docstring for 'catch' function:
------------
Catch errors in a quote

(example)
[1 + "2" +] ["An error has occured." putstrln] catch
[1 2 +] ["Another error has occured." putstrln] catch
== Output ==
An error has occured.
=> []
=> [3]