Anurag Mendhekar
Config is a configuration system for file-based configuration parameters that can be specified as part of the code, but read from a configuration file at run time.
The values provided for the configuration parameters are only partially pre-processed at run-time, but never eval ’d, to avoid security issues.
Configuration parameters are typically what would be expected to be provided in the runtime configuration file. They are declared using one of the following macros.
syntax
[#:path][#:required][#:default-valuev][#:on-repeatrepeat-fn])
The configuration file is a sequence of s-expressions of the form
(param-nameparam-value)
(envENV_VAR)
#:path - The presence of this keyword indicates that the configuration parameter is expected to be a path. The configuration parameter will be expanded using expand-user-path as soon as it is read.
#:required - The presence of this keyword indicates that the configuration parameter must be provided in the config file. A runtime exception is thrown if the parameter is not found.
#:default-valuev - If this configuration parameter is not found in the configuration file, then the default value provided by v is assumed.
(repeated-param"another-value")
("another-value""some-initial-value")
syntax
[#:required][#:default-valuev][#:on-repeatrepeat-fn])
procedure
( read-config fname)→void?
fname:path-or-string?
procedure
Environment variable CONFIG_LOCAL_CFG - The path provided by this environment variable is used as a configuration file. If the path is relative, then it is relative to the current working directory
Default - The file local.cfg under (current-directory ) is used.
syntax
( with-config ((param-nameparam-val)...)body...)