API Reference › Os › Os.has_env
method

Os.has_env

Os.has_env(name) -> bool

Tests whether an environment variable is set, without reading its value. Useful as a feature/debug toggle, or to guard an env read.

Parameters

namethe variable name

Example

program HasEnv {
  entry {
    if Os.has_env("LUDIC_DEBUG") { print(1) } else { print(0) }
  }
}
← All symbols