@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
| Name | Type | Description |
|---|---|---|
key |
Value |
|
value? |
Value |
count … -> Int
Counts distinct keys, or the values of one key. Missing keys count as zero.
Parameters
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
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.