On this page:
define-environment
define/  provide-environment
define-environment-variable
6.3.90.900

3 API Reference

syntax

(define-environment clause ...)

 
clause = name-id
  | [name-id maybe-type option ...]
     
maybe-type = 
  | : type-id
     
option = #:name env-var-name-expr
  | #:default default-expr
Defines a set of variables to be initialized with values from the environment.

Each name-id is assigned the value of the environment variable with the name env-var-name-expr. If no env-var-name-expr is provided, the environment variable name is inferred based on name-id: the identifier is converted to all caps, all dashes are converted to underscores, and all question marks are stripped.

Before being assigned to name-id, the value of the environment variable is parsed based on type-id. If no type-id is provided, the type is inferred to be String. The following types are supported:

If the specified variable does not exist in the environment, name-id is set to the value of default-expr. If no default-expr is provided, an error is raised.

syntax

(define/provide-environment clause ...)

Exactly the same as define-environment but also provides each name-id.

syntax

(define-environment-variable name-id maybe-type option ...)

Exactly the same as define-environment but only defines a single variable. The syntax is the same as define-environment’s clause.