Skip to content

WArray

class WArray

@brief Upstream WAL's array: a string-keyed, insertion-ordered map.

Upstream represents an array as a Python dict, so it is NOT a vector: keys are arbitrary (ints, floats, strings and symbols are all stringified on the way in, which is why (seta a 0 "foo") and (geta a "0") name the same slot), and the value is a mutable reference, so (seta a ...) is visible through every binding that holds the same array.

Insertion order is preserved because mapa iterates in it and upstream's dicts are ordered. Lookup stays O(1) through index_, which maps a key to its slot in entries_.

Functions

Name Description
key_of Canonical key spelling.

Function Details

key_of

static std::string key_of(const Value& v)

Canonical key spelling. Upstream stringifies int, float and Symbol keys, so 0, "0" and '0 are one and the same key.