Qu

save_all

Builtin index · File I/O

save_all(path)

Input: path · Output: no output

What it is

Saves literally every current binding — every user variable plus Qu's own built-in constants (pi, e, tau, none, the Qu* escape-character constants, ...) — to path (string).

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
save_all(path)
path stringnot documented yet
no output—

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

x = 1 to 5
A = [1, 2; 3, 4]
m = ols_model([1;2;3;4], [2;4;6;8])   # a fitted model round-trips too

save_all("session.json")              # every variable currently in scope


# ...later, in a fresh session...

load("session.json")                  # restores x, A, m into the workspace

p = predict(m, [5])                   # -> [10]

from fundamentals

How it works

save(path, "name1", "name2", ...) — save specific top-level variables (by name, as strings — the same "name, not a value" convention pmap/spawn already use) to a JSON file. save_all(path) saves every top-level variable. Neither reaches into an active function's local frame — like MATLAB's own save, this operates on the base workspace. JSON so a saved file is human-readable/diffable, not a custom binary format (see the serde_json dependency's own Cargo.toml comment for the full reasoning). Worker/ Mutex/Semaphore values (live runtime handles, not data) fail the whole save clearly rather than silently dropping just that one variable.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.