Skip to main content

Module env

Module env 

Source
Expand description

Variable environment, Value type, and workspace persistence.

Structs§

LambdaFn
A compiled anonymous function closure with its source text.

Enums§

Value
A value held in the variable environment.

Functions§

config_dir
Returns the platform-specific configuration directory for ccalc.
load_workspace
Loads variables from path into a new Env. Recognises: name = 3.14 (Scalar), name = 'str' (Str), name = "str" (StringObj). Unrecognised lines are silently skipped.
load_workspace_default
Loads variables from the default workspace path (~/.config/ccalc/workspace.toml) into a new Env.
save_workspace
Saves scalars and strings from env to path. Matrices, complex values, and strings with unsafe characters are skipped. Format: name = value per line, where value is a raw f64, 'str', or "strobj".
save_workspace_default
Saves scalars and strings from env to the default workspace path (~/.config/ccalc/workspace.toml).
save_workspace_vars
Saves only the named variables from env to path. Variables not present in env are silently ignored.

Type Aliases§

Env
Variable environment: maps names to values.