saveData
Canonical ID: storage.set. Nederlands: bewaarGegeven.
Saves a JSON-compatible snapshot under an app-private key. Later mutation of the original List or Map does not change that snapshot. Saving an existing key replaces its value atomically; a rejected write leaves the previous value intact. Persistence depends on project identity, not the spelling of the key. Saving does not grant general filesystem access.
Signature
saveData(key, value)
Arguments
| Parameter | Type | Requirement |
|---|---|---|
key |
Text | Nonempty, no surrounding whitespace/control characters, at most 128 UTF-8 bytes. |
value |
JSON-compatible | None, finite numbers, text, Booleans, Lists, or Maps with Text keys. |
Return value
None.
Example
# language: en
let scores = [12, 18]
saveData("scores", scores)
set scores[0] = 99
say loadData("scores", [])
Prints [12, 18]; stored data is a snapshot.
Notes and common mistakes
Use the function name for your source language. Its canonical ID is a shared documentation label; you do not type that ID as a call. Giving your own variable or function the same name can hide the built-in. Supply the documented arguments and value types. Pliro reports mismatches when checking can detect them, or when the call runs.
Keys and saved text are not translated. Limits are 128 keys, 64 KiB per JSON value, 512 KiB per document, 32 nesting levels, and 8,192 values/nodes per value. Functions, nonfinite numbers, and Maps with non-Text keys cannot be stored. A usable portable project identity enables durable data; loose source uses temporary session storage. See the storage guide for E4014–E4017 and copy/identity rules.
Related entries
loadData · deleteData · savedDataKeys · Programming guides · Host support · Calls and arguments
