exit
fn exit(int code) Import
Source: use env::{exit}; compiler/src/builtin_docs/env.hy Ends the process at once with exit status code.
Does not return. Needs --allow-exit; without the grant the program does
not compile (error E0407).
Parameters#
| Name | Type |
|---|---|
code | int |
Examples#
use env::{exit};
let ok = true;
if ok {
exit(0);
}
See also#
args: Returns the program’s command-line arguments, starting with the program name.var: Returns the value of the environment variablename.set_var: Sets the environment variablenametovaluefor this process.remove_var: Removes the environment variablenamefrom this process.cwd: Returns the current working directory as an absolute path.set_cwd: Changes the current working directory of the whole process.exec: Runsprogramwith the argumentsargvand waits for it to finish.