Skip to content

@Map[S @ {...}]

Reads dictionary-like entries, including multiple values for a key. Integer keys retain the positional structure described by S.

Inherits from: BaseMap[S], Index[S]

Fields

len @ Int [get]

The number of pairs, counting repeated keys separately.

Methods

(unpack)() -> Map[S]

Destructures by key, leaving a rest that can also be destructured.

contains key … -> Bool

Tests for a key, or for a matching key and value.

Parameters

NameTypeDescription
key Value
value? Value

count … -> Int

Counts distinct keys, or the values of one key. Missing keys count as zero.

Parameters

NameTypeDescription
key? Value

get[K, D = nil] key … -> (IndexItem[S, K] | D)

Reads an instance, defaulting to the last. Negative instances count backward. Returns nil for a missing instance unless a fallback is supplied.

Parameters

NameTypeDescription
key K
instance? Int
:default? D
:else? (() -> D)

keys() -> Iterable[Keys[S]]

Yields each distinct key once.

pairs() -> Iter[Entries[S]]

Yields key-value pairs, as ordinary iteration does.

values() -> Iterable[Values[S]] overload 1 of 3

Yields all values, or the values of one key.