param_env

Module

Implements functions for interacting with defines.

You can import these APIs from the sys package. For example:

from sys.param_env import is_defined

is_defined

is_defined[name: StringLiteral]() -> Bool

Return true if the environment parameter is defined.

Parameters:

  • name (StringLiteral): The name of the parameter.

Returns:

True if the parameter is defined.

env_get_int

env_get_int[name: StringLiteral]() -> Int

Try to get an integer environment parameter. Compilation fails if the parameter was not set.

Parameters:

  • name (StringLiteral): The name of the parameter.

Returns:

An integer parameter.

env_get_int[name: StringLiteral, default: Int]() -> Int

Try to get an integer environment parameter. If it was not set, return a default value instead.

Parameters:

  • name (StringLiteral): The name of the parameter.
  • default (Int): The default value to use.

Returns:

An integer parameter.

env_get_string

env_get_string[name: StringLiteral]() -> StringLiteral

Try to get a string environment parameter. Compilation fails if the parameter was not set.

Parameters:

  • name (StringLiteral): The name of the parameter.

Returns:

A string parameter.

env_get_string[name: StringLiteral, default: StringLiteral]() -> StringLiteral

Try to get a string environment parameter. If it was not set, return a default value instead.

Parameters:

  • name (StringLiteral): The name of the parameter.
  • default (StringLiteral): The default value to use.

Returns:

A string parameter.