Function in env compiler

exit

fn exit(int code)
Import
use env::{exit};
Source: 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#

NameType
codeint

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 variable name.
  • set_var: Sets the environment variable name to value for this process.
  • remove_var: Removes the environment variable name from this process.
  • cwd: Returns the current working directory as an absolute path.
  • set_cwd: Changes the current working directory of the whole process.
  • exec: Runs program with the arguments argv and waits for it to finish.
↑ ↓ navigate ↵ open