SplitScript reference / IndexAssign

IndexAssign

capability

capability IndexAssign

Replaces or inserts a value through bracket assignment.

Every assignable index is also readable and therefore shares the exact Index.Key and Index.Value types. Source structs participate by defining both the inherited Index.at method and an exact IndexAssign.set method.

Examples

Assign through an index

let scores = Map.new<String, u32>()
scores["Ada"] = 12

Requires

MemberDescriptionAvailable through
IndexReads a value selected by bracket indexing.

Methods

MemberDescriptionAvailable through
setStores a value selected by a key.