Skip to content

Collections

Scrolls behave like ordered lists; lexicons are rune-keyed dictionaries. Literals mimic JSON, and indexing uses familiar brackets.

forge spellbook: scroll = ["ignite", 42, boon];
forge grimoire: lexicon = {
"sun": "radiant",
"moon": "serene",
};
unveil(spellbook[0]); // "ignite"
unveil(grimoire["moon"]); // "serene"
forge morph satchel: scroll = [1, 2];
satchel[1] = 3;

Methods keep APIs uniform with artifact calls.

  • scroll.tally() → length as arcana.
  • scroll.scribe(value) → append to a morph scroll.
  • scroll.extract() → pop the last entry from a morph scroll.
  • scroll.sort() → new ascending scroll (homogeneous arcana, aether, or rune elements); the receiver is untouched.
  • scroll.unique() → new scroll keeping the first occurrence of each scalar value.
  • scroll.sum() → total of a numeric scroll (arcana or aether).
  • scroll.min() / scroll.max() → an augury: manifest { value } with the smallest / largest element, or naught {} for an empty scroll (see Error Handling).

sum raises an error on an empty scroll; mixed-type scrolls are an error for all aggregation methods.

forge rolls: scroll = [3, 1, 2, 3, 1];
unveil(rolls.sort());
unveil(rolls.unique());
unveil(rolls.sum().transmute(rune));
oracle (rolls.min()) {
manifest { value } => unveil(value);
naught {} => unveil("empty scroll");
};
[1, 1, 2, 3, 3]
[3, 1, 2]
10
1
  • lexicon.tally() → number of rune entries.
  • lexicon.define("key", value) → insert/update.
  • lexicon.expunge("key") → remove an entry.
  • lexicon.glossary() → returns a scroll of rune keys.
forge morph pack: scroll = ["ember"];
pack.scribe("frost");
unveil(pack.tally()); // 2
unveil(pack.extract()); // "frost"
forge morph ledger: lexicon = {"alpha": 1, "beta": 2};
ledger.expunge("alpha");
ledger.define("gamma", 3);
unveil(ledger.glossary()); // ["beta", "gamma"]

Mutating calls require morph bindings—the evaluator surfaces diagnostics instead of cloning data accidentally.