Skip to main content

Mojo function

env_get_bool

env_get_bool[name: StringSlice[StaticConstantOrigin]]() -> Bool

Try to get a boolean-valued define. Compilation fails if the name is not defined or the value is not a recognized boolean (True, False, 1, 0, on, off).

Deprecated: use get_defined_bool from sys.defines instead

Parameters:

Returns:

Bool: A boolean parameter value.

env_get_bool[name: StringSlice[StaticConstantOrigin], default: Bool]() -> Bool

Try to get a boolean-valued define. If the name is not defined, return a default value instead. The value must be a recognized boolean (True, False, 1, 0, on, off).

Deprecated: use get_defined_bool from sys.defines instead

Parameters:

  • โ€‹name (StringSlice): The name of the define.
  • โ€‹default (Bool): The default value to use.

Returns:

Bool: A boolean parameter value.

Was this page helpful?