Mappings

Denys Duchier

module
x-oz://system/Mapping.ozf

This module provides a uniform interface to standard mapping datatypes, i.e. records, dictionaries and arrays

Exports

{Mapping.get +M +Key ?Value}
returns the Value associated with Key in mapping M
{Mapping.put +M +Key +Value}
sets the Value associated with Key in mapping M (assuming the latter is mutable)
{Mapping.condGet +M +Key +Default ?Value}
{Mapping.condSelect +M +Key +Default ?Value}
returns the Value associated with Key in mapping M, or Default if none
{Mapping.is +M ?B}
returns true iff M is a mapping
{Mapping.isMutable +M ?B}
returns true iff M is a mutable mapping
{Mapping.items +M ?L}
{Mapping.toList +M ?L}
returns a list of the values in the mapping
{Mapping.keys +M ?L}
{Mapping.arity +M ?L}
returns a list of the keys of the mapping
{Mapping.entries +M ?L}
{Mapping.toListInd +M ?L}
returns a list of the entries Key#Value in the mapping
{Mapping.clone +M1 ?M2}
returns a clone M2 of the mapping M1
{Mapping.exchange +M +Key ?Old +New}
atomically exchanges the value for Key in mapping M: sets it to New while returning Old
{Mapping.toRecord +Label +M ?R}
returns a record R with label Label representing the entries in mapping M