lib/typed-map.x
Typed Maps generated from shared storage.
Primary API
| Function | Summary |
|---|---|
Map.mapintint | Packs entries into a fresh typed map in the current Scope. |
Map.maplongdouble | Packs entries into a fresh typed map in the current Scope. |
Map.mapstringint | Packs entries into a fresh typed map in the current Scope. |
Map.mapstringstring | Packs entries into a fresh typed map in the current Scope. |
MapIntInt.cleanup | Releases the record and its backing Blocks, borrowing stored values. |
MapIntInt.compare | Compares typed Maps by size and then sorted native key/value contents. |
MapIntInt.contains | Returns one when key is present, or zero for a null map. |
MapIntInt.copy | Returns a fresh shallow copy in the current Scope. |
MapIntInt.del | Removes key and returns its value. |
MapIntInt.enumerate | Initializes dest to yield canonical (key value) Lists in bucket order. |
MapIntInt.equal | Reports key/value equality independent of bucket and insertion order. |
MapIntInt.get | Returns the value for key. |
MapIntInt.getdefault | Returns the value for key, or defval without inserting it. |
MapIntInt.getindex | Returns the value selected by bracket indexing. |
MapIntInt.iter | Initializes dest as a single-pass iterator over boxed values. |
MapIntInt.keys | Initializes dest as a single-pass iterator over boxed keys. |
MapIntInt.len | Returns the number of entries, or zero for a null map. |
MapIntInt.map | Returns a fresh ordinary Map containing boxed keys and values. |
MapIntInt.merge | Copies every entry of other into map and returns the destination. |
MapIntInt.new | Returns a fresh empty map owned by the current Scope. |
MapIntInt.new_capacity | Returns a fresh empty map with exactly capacity buckets. |
MapIntInt.postfixindex | Applies postfix ++ or -- and returns the previous value. |
MapIntInt.repr | Returns the readable typed-Map representation. |
MapIntInt.set | Copies key and val into the table, replacing an existing value. |
MapIntInt.setdefault | Returns the value for key, inserting defval when absent. |
MapIntInt.setindex | Stores val under key and returns val. |
MapIntInt.str | Returns the typed-Map display String. |
MapIntInt.truth | Returns one when map contains an entry. |
MapIntInt.try_del | Removes key, writes its value to out, and returns one when present. |
MapIntInt.try_get | Writes the value for key to out and returns one when present. |
MapIntInt.try_next | Writes the next bucket’s key and value, advances cursor, and returns one. |
MapIntInt.updateindex | Applies op to the value for key and returns the stored result. |
MapIntInt.var | Boxes map with its registered typed-map tag without copying it. |
MapIntInt.write_repr | Appends the readable typed-Map representation in bucket order. |
MapIntInt.write_str | Appends the typed-Map display text in bucket order. |
MapLongDouble.cleanup | Releases the record and its backing Blocks, borrowing stored values. |
MapLongDouble.compare | Compares typed Maps by size and then sorted native key/value contents. |
MapLongDouble.contains | Returns one when key is present, or zero for a null map. |
MapLongDouble.copy | Returns a fresh shallow copy in the current Scope. |
MapLongDouble.del | Removes key and returns its value. |
MapLongDouble.enumerate | Initializes dest to yield canonical (key value) Lists in bucket order. |
MapLongDouble.equal | Reports key/value equality independent of bucket and insertion order. |
MapLongDouble.get | Returns the value for key. |
MapLongDouble.getdefault | Returns the value for key, or defval without inserting it. |
MapLongDouble.getindex | Returns the value selected by bracket indexing. |
MapLongDouble.iter | Initializes dest as a single-pass iterator over boxed values. |
MapLongDouble.keys | Initializes dest as a single-pass iterator over boxed keys. |
MapLongDouble.len | Returns the number of entries, or zero for a null map. |
MapLongDouble.map | Returns a fresh ordinary Map containing boxed keys and values. |
MapLongDouble.merge | Copies every entry of other into map and returns the destination. |
MapLongDouble.new | Returns a fresh empty map owned by the current Scope. |
MapLongDouble.new_capacity | Returns a fresh empty map with exactly capacity buckets. |
MapLongDouble.postfixindex | Applies postfix ++ or -- and returns the previous value. |
MapLongDouble.repr | Returns the readable typed-Map representation. |
MapLongDouble.set | Copies key and val into the table, replacing an existing value. |
MapLongDouble.setdefault | Returns the value for key, inserting defval when absent. |
MapLongDouble.setindex | Stores val under key and returns val. |
MapLongDouble.str | Returns the typed-Map display String. |
MapLongDouble.truth | Returns one when map contains an entry. |
MapLongDouble.try_del | Removes key, writes its value to out, and returns one when present. |
MapLongDouble.try_get | Writes the value for key to out and returns one when present. |
MapLongDouble.try_next | Writes the next bucket’s key and value, advances cursor, and returns one. |
MapLongDouble.updateindex | Applies op to the value for key and returns the stored result. |
MapLongDouble.var | Boxes map with its registered typed-map tag without copying it. |
MapLongDouble.write_repr | Appends the readable typed-Map representation in bucket order. |
MapLongDouble.write_str | Appends the typed-Map display text in bucket order. |
MapStringInt.cleanup | Releases the record and its backing Blocks, borrowing stored values. |
MapStringInt.compare | Compares typed Maps by size and then sorted native key/value contents. |
MapStringInt.contains | Returns one when key is present, or zero for a null map. |
MapStringInt.copy | Returns a fresh shallow copy in the current Scope. |
MapStringInt.del | Removes key and returns its value. |
MapStringInt.enumerate | Initializes dest to yield canonical (key value) Lists in bucket order. |
MapStringInt.equal | Reports key/value equality independent of bucket and insertion order. |
MapStringInt.get | Returns the value for key. |
MapStringInt.getdefault | Returns the value for key, or defval without inserting it. |
MapStringInt.getindex | Returns the value selected by bracket indexing. |
MapStringInt.iter | Initializes dest as a single-pass iterator over boxed values. |
MapStringInt.keys | Initializes dest as a single-pass iterator over boxed keys. |
MapStringInt.len | Returns the number of entries, or zero for a null map. |
MapStringInt.map | Returns a fresh ordinary Map containing boxed keys and values. |
MapStringInt.merge | Copies every entry of other into map and returns the destination. |
MapStringInt.new | Returns a fresh empty map owned by the current Scope. |
MapStringInt.new_capacity | Returns a fresh empty map with exactly capacity buckets. |
MapStringInt.postfixindex | Applies postfix ++ or -- and returns the previous value. |
MapStringInt.repr | Returns the readable typed-Map representation. |
MapStringInt.set | Copies key and val into the table, replacing an existing value. |
MapStringInt.setdefault | Returns the value for key, inserting defval when absent. |
MapStringInt.setindex | Stores val under key and returns val. |
MapStringInt.str | Returns the typed-Map display String. |
MapStringInt.truth | Returns one when map contains an entry. |
MapStringInt.try_del | Removes key, writes its value to out, and returns one when present. |
MapStringInt.try_get | Writes the value for key to out and returns one when present. |
MapStringInt.try_next | Writes the next bucket’s key and value, advances cursor, and returns one. |
MapStringInt.updateindex | Applies op to the value for key and returns the stored result. |
MapStringInt.var | Boxes map with its registered typed-map tag without copying it. |
MapStringInt.write_repr | Appends the readable typed-Map representation in bucket order. |
MapStringInt.write_str | Appends the typed-Map display text in bucket order. |
MapStringString.cleanup | Releases the record and its backing Blocks, borrowing stored values. |
MapStringString.compare | Compares typed Maps by size and then sorted native key/value contents. |
MapStringString.contains | Returns one when key is present, or zero for a null map. |
MapStringString.copy | Returns a fresh shallow copy in the current Scope. |
MapStringString.del | Removes key and returns its value. |
MapStringString.enumerate | Initializes dest to yield canonical (key value) Lists in bucket order. |
MapStringString.equal | Reports key/value equality independent of bucket and insertion order. |
MapStringString.get | Returns the value for key. |
MapStringString.getdefault | Returns the value for key, or defval without inserting it. |
MapStringString.getindex | Returns the value selected by bracket indexing. |
MapStringString.iter | Initializes dest as a single-pass iterator over boxed values. |
MapStringString.keys | Initializes dest as a single-pass iterator over boxed keys. |
MapStringString.len | Returns the number of entries, or zero for a null map. |
MapStringString.map | Returns a fresh ordinary Map containing boxed keys and values. |
MapStringString.merge | Copies every entry of other into map and returns the destination. |
MapStringString.new | Returns a fresh empty map owned by the current Scope. |
MapStringString.new_capacity | Returns a fresh empty map with exactly capacity buckets. |
MapStringString.postfixindex | Applies postfix ++ or -- and returns the previous value. |
MapStringString.repr | Returns the readable typed-Map representation. |
MapStringString.set | Copies key and val into the table, replacing an existing value. |
MapStringString.setdefault | Returns the value for key, inserting defval when absent. |
MapStringString.setindex | Stores val under key and returns val. |
MapStringString.str | Returns the typed-Map display String. |
MapStringString.truth | Returns one when map contains an entry. |
MapStringString.try_del | Removes key, writes its value to out, and returns one when present. |
MapStringString.try_get | Writes the value for key to out and returns one when present. |
MapStringString.try_next | Writes the next bucket’s key and value, advances cursor, and returns one. |
MapStringString.updateindex | Applies op to the value for key and returns the stored result. |
MapStringString.var | Boxes map with its registered typed-map tag without copying it. |
MapStringString.write_repr | Appends the readable typed-Map representation in bucket order. |
MapStringString.write_str | Appends the typed-Map display text in bucket order. |
Var.mapintint | Returns the typed-map pointer carried by value. |
Var.maplongdouble | Returns the typed-map pointer carried by value. |
Var.mapstringint | Returns the typed-map pointer carried by value. |
Var.mapstringstring | Returns the typed-map pointer carried by value. |
Map
Map.mapintint
MapIntInt Map.mapintint(Map entries)
Packs entries into a fresh typed map in the current Scope.
A null input returns NULL. Each key and value goes through its Var
conversion, and later entries in bucket order replace earlier equal keys.
The input Map is unchanged.
Raises: any conversion cause, or <alloc-fail>, <size-limit>, or
<invariant> while inserting.
Source: lib/typed-map.x:232
Map.maplongdouble
MapLongDouble Map.maplongdouble(Map entries)
Packs entries into a fresh typed map in the current Scope.
A null input returns NULL. Each key and value goes through its Var
conversion, and later entries in bucket order replace earlier equal keys.
The input Map is unchanged.
Raises: any conversion cause, or <alloc-fail>, <size-limit>, or
<invariant> while inserting.
Source: lib/typed-map.x:252
Map.mapstringint
MapStringInt Map.mapstringint(Map entries)
Packs entries into a fresh typed map in the current Scope.
A null input returns NULL. Each key and value goes through its Var
conversion, and later entries in bucket order replace earlier equal keys.
The input Map is unchanged.
Raises: any conversion cause, or <alloc-fail>, <size-limit>, or
<invariant> while inserting.
Source: lib/typed-map.x:311
Map.mapstringstring
MapStringString Map.mapstringstring(Map entries)
Packs entries into a fresh typed map in the current Scope.
A null input returns NULL. Each key and value goes through its Var
conversion, and later entries in bucket order replace earlier equal keys.
The input Map is unchanged.
Raises: any conversion cause, or <alloc-fail>, <size-limit>, or
<invariant> while inserting.
Source: lib/typed-map.x:273
MapIntInt
MapIntInt.cleanup
void MapIntInt.cleanup(MapIntInt map)
Releases the record and its backing Blocks, borrowing stored values.
Source: lib/typed-map.x:241
MapIntInt.compare
int MapIntInt.compare(MapIntInt a, MapIntInt b)
Compares typed Maps by size and then sorted native key/value contents.
Identical handles compare equal and NULL sorts first. Neither Map is
mutated. Raises: <alloc-fail> while creating temporary storage, or any
cause from key or value comparison.
Source: lib/typed-map.x:240
MapIntInt.contains
int MapIntInt.contains(MapIntInt map, int key)
Returns one when key is present, or zero for a null map.
Source: lib/typed-map.x:232
MapIntInt.copy
MapIntInt MapIntInt.copy(MapIntInt map)
Returns a fresh shallow copy in the current Scope.
The result has independent table storage but copies native key and value
fields. A null input produces a fresh empty map.
Raises: an allocation, size, or invariant cause while copying.
Source: lib/typed-map.x:232
MapIntInt.del
int MapIntInt.del(MapIntInt map, int key)
Removes key and returns its value.
Successful removal invalidates live cursors and iterators.
Prefer try_del when absence is an ordinary outcome. Boxed families
return void for absence; native families raise <bad-arg>.
Source: lib/typed-map.x:232
MapIntInt.enumerate
Iter MapIntInt.enumerate(MapIntInt map, Iter dest)
Initializes dest to yield canonical (key value) Lists in bucket
order.
The caller owns dest, and the iterator borrows map; both must remain
live during traversal. A null dest returns NULL, and a null map is
exhausted. Each step boxes both fields and interns two List cells. Each
cell belongs to the pool owning its canonical match, which may be an
ancestor pool, or to the current pool when newly allocated. Structural
mutation invalidates the iterator. Each MapLongDouble pull allocates its
long key as a Var in the current Scope; the yielded List and
anything
retaining it must not outlive that Scope.
Raises: <alloc-fail> or <size-limit> while interning the List, and
for MapLongDouble, <alloc-fail> or <bad-enc> while boxing its key.
Shared causes do not return from the pull.
Source: lib/typed-map.x:241
MapIntInt.equal
int MapIntInt.equal(MapIntInt a, MapIntInt b)
Reports key/value equality independent of bucket and insertion order. Two null maps compare equal; a null and a nonnull map compare unequal.
Source: lib/typed-map.x:232
MapIntInt.get
int MapIntInt.get(MapIntInt map, int key)
Returns the value for key.
Prefer try_get when absence is an ordinary outcome. Boxed families
return void for absence; native families raise <bad-arg>.
Source: lib/typed-map.x:232
MapIntInt.getdefault
int MapIntInt.getdefault(MapIntInt map, int key, int defval)
Returns the value for key, or defval without inserting it.
A null map is treated as an empty one.
Source: lib/typed-map.x:232
MapIntInt.getindex
int MapIntInt.getindex(MapIntInt map, int key)
Returns the value selected by bracket indexing.
This is the bracket-facing form of MapIntInt.get, with the same failure
behavior. Prefer bracket indexing in ordinary code.
Source: lib/typed-map.x:232
MapIntInt.iter
Iter MapIntInt.iter(MapIntInt map, Iter dest)
Initializes dest as a single-pass iterator over boxed values.
The caller owns dest, and the iterator borrows map; both must remain
live during traversal. A null dest returns NULL. Values follow bucket
order, a null map is exhausted, and structural mutation invalidates the
iterator.
Source: lib/typed-map.x:241
MapIntInt.keys
Iter MapIntInt.keys(MapIntInt map, Iter dest)
Initializes dest as a single-pass iterator over boxed keys.
The caller owns dest, and the iterator borrows map; both must remain
live during traversal. A null dest returns NULL. Keys follow bucket
order, a null map is exhausted, and structural mutation invalidates the
iterator. MapIntInt and both String-keyed families box keys without
allocation.
Each MapLongDouble pull allocates its long key as a Var in the current
Scope; the yielded Var and anything retaining it must
not outlive that
Scope.
Raises: MapLongDouble iteration may raise <alloc-fail> or <bad-enc>
while boxing a key.
Source: lib/typed-map.x:241
MapIntInt.len
unsigned MapIntInt.len(MapIntInt map)
Returns the number of entries, or zero for a null map.
Source: lib/typed-map.x:232
MapIntInt.map
Map MapIntInt.map(MapIntInt map)
Returns a fresh ordinary Map containing boxed keys and values. A null input returns NULL. The typed Map and its storage are unchanged.
Raises: any cause from boxing or inserting an entry.
Source: lib/typed-map.x:240
MapIntInt.merge
MapIntInt MapIntInt.merge(MapIntInt map, MapIntInt other)
Copies every entry of other into map and returns the destination.
other wins conflicts. A null other is a no-op; a null destination is
replaced by a fresh map. When a supplied destination fails partway,
entries already copied remain; a newly created destination is discarded.
Raises: an allocation, size, or invariant cause while inserting.
Source: lib/typed-map.x:232
MapIntInt.new
MapIntInt MapIntInt.new(void)
Returns a fresh empty map owned by the current Scope.
The initial table has two buckets and grows automatically.
Raises: <alloc-fail> or <size-limit> when storage cannot be created.
Source: lib/typed-map.x:232
MapIntInt.new_capacity
MapIntInt MapIntInt.new_capacity(unsigned capacity)
Returns a fresh empty map with exactly capacity buckets.
The result and its backing arrays belong to the current Scope.
capacity
must be a power of two of at least two.
Raises: <bad-arg> for another capacity, or <alloc-fail> /
<size-limit> when storage cannot be created.
Source: lib/typed-map.x:232
MapIntInt.postfixindex
int MapIntInt.postfixindex(MapIntInt map, int key, Symbol op)
Applies postfix ++ or -- and returns the previous value.
The key must already exist, and only generated numeric families support
these operations.
Raises: <bad-arg> for a null map or absent key, or <bad-op> for an
unsupported operation. These failures leave the value unchanged.
Source: lib/typed-map.x:232
MapIntInt.repr
String MapIntInt.repr(MapIntInt map)
Returns the readable typed-Map representation.
Source: lib/typed-map.x:240
MapIntInt.set
void MapIntInt.set(MapIntInt map, int key, int val)
Copies key and val into the table, replacing an existing value.
Insertion invalidates live cursors and iterators; replacement does not.
Raises: <bad-arg> for a null map, or an allocation, size, or invariant
cause while inserting. Allocation and size failures leave the table
unchanged.
Source: lib/typed-map.x:232
MapIntInt.setdefault
int MapIntInt.setdefault(MapIntInt map, int key, int defval)
Returns the value for key, inserting defval when absent.
Insertion copies the native key and value fields and invalidates live
cursors and iterators; an existing-key read does not mutate the table.
Raises: <bad-arg> for a null map, or an allocation, size, or invariant
cause while inserting. Allocation and size failures leave the table
unchanged.
Source: lib/typed-map.x:232
MapIntInt.setindex
int MapIntInt.setindex(MapIntInt map, int key, int val)
Stores val under key and returns val.
This is the bracket-facing form of MapIntInt.set, with the same cursor
invalidation and failure behavior.
Source: lib/typed-map.x:232
MapIntInt.str
String MapIntInt.str(MapIntInt map)
Returns the typed-Map display String.
Source: lib/typed-map.x:240
MapIntInt.truth
int MapIntInt.truth(MapIntInt map)
Returns one when map contains an entry.
Source: lib/typed-map.x:232
MapIntInt.try_del
int MapIntInt.try_del(MapIntInt map, int key, int &?out)
Removes key, writes its value to out, and returns one when present.
A null map, null out, or absent key returns zero without writing or
mutation. Successful removal invalidates live cursors and iterators.
Source: lib/typed-map.x:232
MapIntInt.try_get
int MapIntInt.try_get(MapIntInt map, int key, int &?out)
Writes the value for key to out and returns one when present.
A null map, null out, or absent key returns zero without writing.
Source: lib/typed-map.x:232
MapIntInt.try_next
int MapIntInt.try_next(MapIntInt map, unsigned &?cursor, int &?key, int &?val)
Writes the next bucket’s key and value, advances cursor, and returns
one. Initialize the caller-owned cursor to zero. A null argument or
exhaustion returns zero without changing key or val. Traversal
follows bucket order, not insertion order, and structural mutation
invalidates the cursor.
Source: lib/typed-map.x:232
MapIntInt.updateindex
int MapIntInt.updateindex(MapIntInt map, int key, Symbol op, int rhs)
Applies op to the value for key and returns the stored result.
+ inserts rhs when the key is absent; other operations require an
existing key. Supported operations depend on the generated value type.
Raises: <bad-arg> for a null map or missing required key, a cause from
the generated value operation, or an allocation, size, or invariant cause
while inserting. Invalid operations leave an existing value unchanged.
Allocation and size failures leave the table unchanged.
Source: lib/typed-map.x:232
MapIntInt.var
Var MapIntInt.var(MapIntInt map)
Boxes map with its registered typed-map tag without copying it.
The typed pointer and Var share the same mutable map identity.
Source: lib/typed-map.x:241
MapIntInt.write_repr
Buffer MapIntInt.write_repr(MapIntInt map, Buffer out)
Appends the readable typed-Map representation in bucket order.
Source: lib/typed-map.x:240
MapIntInt.write_str
Buffer MapIntInt.write_str(MapIntInt map, Buffer out)
Appends the typed-Map display text in bucket order.
Source: lib/typed-map.x:240
MapLongDouble
MapLongDouble.cleanup
void MapLongDouble.cleanup(MapLongDouble map)
Releases the record and its backing Blocks, borrowing stored values.
Source: lib/typed-map.x:261
MapLongDouble.compare
int MapLongDouble.compare(MapLongDouble a, MapLongDouble b)
Compares typed Maps by size and then sorted native key/value contents.
Identical handles compare equal and NULL sorts first. Neither Map is
mutated. Raises: <alloc-fail> while creating temporary storage, or any
cause from key or value comparison.
Source: lib/typed-map.x:260
MapLongDouble.contains
int MapLongDouble.contains(MapLongDouble map, long key)
Returns one when key is present, or zero for a null map.
Source: lib/typed-map.x:252
MapLongDouble.copy
MapLongDouble MapLongDouble.copy(MapLongDouble map)
Returns a fresh shallow copy in the current Scope.
The result has independent table storage but copies native key and value
fields. A null input produces a fresh empty map.
Raises: an allocation, size, or invariant cause while copying.
Source: lib/typed-map.x:252
MapLongDouble.del
double MapLongDouble.del(MapLongDouble map, long key)
Removes key and returns its value.
Successful removal invalidates live cursors and iterators.
Prefer try_del when absence is an ordinary outcome. Boxed families
return void for absence; native families raise <bad-arg>.
Source: lib/typed-map.x:252
MapLongDouble.enumerate
Iter MapLongDouble.enumerate(MapLongDouble map, Iter dest)
Initializes dest to yield canonical (key value) Lists in bucket
order.
The caller owns dest, and the iterator borrows map; both must remain
live during traversal. A null dest returns NULL, and a null map is
exhausted. Each step boxes both fields and interns two List cells. Each
cell belongs to the pool owning its canonical match, which may be an
ancestor pool, or to the current pool when newly allocated. Structural
mutation invalidates the iterator. Each MapLongDouble pull allocates its
long key as a Var in the current Scope; the yielded List and
anything
retaining it must not outlive that Scope.
Raises: <alloc-fail> or <size-limit> while interning the List, and
for MapLongDouble, <alloc-fail> or <bad-enc> while boxing its key.
Shared causes do not return from the pull.
Source: lib/typed-map.x:261
MapLongDouble.equal
int MapLongDouble.equal(MapLongDouble a, MapLongDouble b)
Reports key/value equality independent of bucket and insertion order. Two null maps compare equal; a null and a nonnull map compare unequal.
Source: lib/typed-map.x:252
MapLongDouble.get
double MapLongDouble.get(MapLongDouble map, long key)
Returns the value for key.
Prefer try_get when absence is an ordinary outcome. Boxed families
return void for absence; native families raise <bad-arg>.
Source: lib/typed-map.x:252
MapLongDouble.getdefault
double MapLongDouble.getdefault(MapLongDouble map, long key, double defval)
Returns the value for key, or defval without inserting it.
A null map is treated as an empty one.
Source: lib/typed-map.x:252
MapLongDouble.getindex
double MapLongDouble.getindex(MapLongDouble map, long key)
Returns the value selected by bracket indexing.
This is the bracket-facing form of MapLongDouble.get, with the same failure
behavior. Prefer bracket indexing in ordinary code.
Source: lib/typed-map.x:252
MapLongDouble.iter
Iter MapLongDouble.iter(MapLongDouble map, Iter dest)
Initializes dest as a single-pass iterator over boxed values.
The caller owns dest, and the iterator borrows map; both must remain
live during traversal. A null dest returns NULL. Values follow bucket
order, a null map is exhausted, and structural mutation invalidates the
iterator.
Source: lib/typed-map.x:261
MapLongDouble.keys
Iter MapLongDouble.keys(MapLongDouble map, Iter dest)
Initializes dest as a single-pass iterator over boxed keys.
The caller owns dest, and the iterator borrows map; both must remain
live during traversal. A null dest returns NULL. Keys follow bucket
order, a null map is exhausted, and structural mutation invalidates the
iterator. MapIntInt and both String-keyed families box keys without
allocation.
Each MapLongDouble pull allocates its long key as a Var in the current
Scope; the yielded Var and anything retaining it must
not outlive that
Scope.
Raises: MapLongDouble iteration may raise <alloc-fail> or <bad-enc>
while boxing a key.
Source: lib/typed-map.x:261
MapLongDouble.len
unsigned MapLongDouble.len(MapLongDouble map)
Returns the number of entries, or zero for a null map.
Source: lib/typed-map.x:252
MapLongDouble.map
Map MapLongDouble.map(MapLongDouble map)
Returns a fresh ordinary Map containing boxed keys and values. A null input returns NULL. The typed Map and its storage are unchanged.
Raises: any cause from boxing or inserting an entry.
Source: lib/typed-map.x:260
MapLongDouble.merge
MapLongDouble MapLongDouble.merge(MapLongDouble map, MapLongDouble other)
Copies every entry of other into map and returns the destination.
other wins conflicts. A null other is a no-op; a null destination is
replaced by a fresh map. When a supplied destination fails partway,
entries already copied remain; a newly created destination is discarded.
Raises: an allocation, size, or invariant cause while inserting.
Source: lib/typed-map.x:252
MapLongDouble.new
MapLongDouble MapLongDouble.new(void)
Returns a fresh empty map owned by the current Scope.
The initial table has two buckets and grows automatically.
Raises: <alloc-fail> or <size-limit> when storage cannot be created.
Source: lib/typed-map.x:252
MapLongDouble.new_capacity
MapLongDouble MapLongDouble.new_capacity(unsigned capacity)
Returns a fresh empty map with exactly capacity buckets.
The result and its backing arrays belong to the current Scope.
capacity
must be a power of two of at least two.
Raises: <bad-arg> for another capacity, or <alloc-fail> /
<size-limit> when storage cannot be created.
Source: lib/typed-map.x:252
MapLongDouble.postfixindex
double MapLongDouble.postfixindex(MapLongDouble map, long key, Symbol op)
Applies postfix ++ or -- and returns the previous value.
The key must already exist, and only generated numeric families support
these operations.
Raises: <bad-arg> for a null map or absent key, or <bad-op> for an
unsupported operation. These failures leave the value unchanged.
Source: lib/typed-map.x:252
MapLongDouble.repr
String MapLongDouble.repr(MapLongDouble map)
Returns the readable typed-Map representation.
Source: lib/typed-map.x:260
MapLongDouble.set
void MapLongDouble.set(MapLongDouble map, long key, double val)
Copies key and val into the table, replacing an existing value.
Insertion invalidates live cursors and iterators; replacement does not.
Raises: <bad-arg> for a null map, or an allocation, size, or invariant
cause while inserting. Allocation and size failures leave the table
unchanged.
Source: lib/typed-map.x:252
MapLongDouble.setdefault
double MapLongDouble.setdefault(MapLongDouble map, long key, double defval)
Returns the value for key, inserting defval when absent.
Insertion copies the native key and value fields and invalidates live
cursors and iterators; an existing-key read does not mutate the table.
Raises: <bad-arg> for a null map, or an allocation, size, or invariant
cause while inserting. Allocation and size failures leave the table
unchanged.
Source: lib/typed-map.x:252
MapLongDouble.setindex
double MapLongDouble.setindex(MapLongDouble map, long key, double val)
Stores val under key and returns val.
This is the bracket-facing form of MapLongDouble.set, with the same cursor
invalidation and failure behavior.
Source: lib/typed-map.x:252
MapLongDouble.str
String MapLongDouble.str(MapLongDouble map)
Returns the typed-Map display String.
Source: lib/typed-map.x:260
MapLongDouble.truth
int MapLongDouble.truth(MapLongDouble map)
Returns one when map contains an entry.
Source: lib/typed-map.x:252
MapLongDouble.try_del
int MapLongDouble.try_del(MapLongDouble map, long key, double &?out)
Removes key, writes its value to out, and returns one when present.
A null map, null out, or absent key returns zero without writing or
mutation. Successful removal invalidates live cursors and iterators.
Source: lib/typed-map.x:252
MapLongDouble.try_get
int MapLongDouble.try_get(MapLongDouble map, long key, double &?out)
Writes the value for key to out and returns one when present.
A null map, null out, or absent key returns zero without writing.
Source: lib/typed-map.x:252
MapLongDouble.try_next
int MapLongDouble.try_next(MapLongDouble map, unsigned &?cursor, long &?key, double &?val)
Writes the next bucket’s key and value, advances cursor, and returns
one. Initialize the caller-owned cursor to zero. A null argument or
exhaustion returns zero without changing key or val. Traversal
follows bucket order, not insertion order, and structural mutation
invalidates the cursor.
Source: lib/typed-map.x:252
MapLongDouble.updateindex
double MapLongDouble.updateindex(MapLongDouble map, long key, Symbol op, double rhs)
Applies op to the value for key and returns the stored result.
+ inserts rhs when the key is absent; other operations require an
existing key. Supported operations depend on the generated value type.
Raises: <bad-arg> for a null map or missing required key, a cause from
the generated value operation, or an allocation, size, or invariant cause
while inserting. Invalid operations leave an existing value unchanged.
Allocation and size failures leave the table unchanged.
Source: lib/typed-map.x:252
MapLongDouble.var
Var MapLongDouble.var(MapLongDouble map)
Boxes map with its registered typed-map tag without copying it.
The typed pointer and Var share the same mutable map identity.
Source: lib/typed-map.x:261
MapLongDouble.write_repr
Buffer MapLongDouble.write_repr(MapLongDouble map, Buffer out)
Appends the readable typed-Map representation in bucket order.
Source: lib/typed-map.x:260
MapLongDouble.write_str
Buffer MapLongDouble.write_str(MapLongDouble map, Buffer out)
Appends the typed-Map display text in bucket order.
Source: lib/typed-map.x:260
MapStringInt
MapStringInt.cleanup
void MapStringInt.cleanup(MapStringInt map)
Releases the record and its backing Blocks, borrowing stored values.
Source: lib/typed-map.x:336
MapStringInt.compare
int MapStringInt.compare(MapStringInt a, MapStringInt b)
Compares typed Maps by size and then sorted native key/value contents.
Identical handles compare equal and NULL sorts first. Neither Map is
mutated. Raises: <alloc-fail> while creating temporary storage, or any
cause from key or value comparison.
Source: lib/typed-map.x:319
MapStringInt.contains
int MapStringInt.contains(MapStringInt map, String key)
Returns one when key is present, or zero for a null map.
Source: lib/typed-map.x:311
MapStringInt.copy
MapStringInt MapStringInt.copy(MapStringInt map)
Returns a fresh shallow copy in the current Scope.
The result has independent table storage but copies native key and value
fields. A null input produces a fresh empty map.
Raises: an allocation, size, or invariant cause while copying.
Source: lib/typed-map.x:311
MapStringInt.del
int MapStringInt.del(MapStringInt map, String key)
Removes key and returns its value.
Successful removal invalidates live cursors and iterators.
Prefer try_del when absence is an ordinary outcome. Boxed families
return void for absence; native families raise <bad-arg>.
Source: lib/typed-map.x:311
MapStringInt.enumerate
Iter MapStringInt.enumerate(MapStringInt map, Iter dest)
Initializes dest to yield canonical (key value) Lists in bucket
order.
The caller owns dest, and the iterator borrows map; both must remain
live during traversal. A null dest returns NULL, and a null map is
exhausted. Each step boxes both fields and interns two List cells. Each
cell belongs to the pool owning its canonical match, which may be an
ancestor pool, or to the current pool when newly allocated. Structural
mutation invalidates the iterator. Each MapLongDouble pull allocates its
long key as a Var in the current Scope; the yielded List and
anything
retaining it must not outlive that Scope.
Raises: <alloc-fail> or <size-limit> while interning the List, and
for MapLongDouble, <alloc-fail> or <bad-enc> while boxing its key.
Shared causes do not return from the pull.
Source: lib/typed-map.x:336
MapStringInt.equal
int MapStringInt.equal(MapStringInt a, MapStringInt b)
Reports key/value equality independent of bucket and insertion order. Two null maps compare equal; a null and a nonnull map compare unequal.
Source: lib/typed-map.x:311
MapStringInt.get
int MapStringInt.get(MapStringInt map, String key)
Returns the value for key.
Prefer try_get when absence is an ordinary outcome. Boxed families
return void for absence; native families raise <bad-arg>.
Source: lib/typed-map.x:311
MapStringInt.getdefault
int MapStringInt.getdefault(MapStringInt map, String key, int defval)
Returns the value for key, or defval without inserting it.
A null map is treated as an empty one.
Source: lib/typed-map.x:311
MapStringInt.getindex
int MapStringInt.getindex(MapStringInt map, String key)
Returns the value selected by bracket indexing.
This is the bracket-facing form of MapStringInt.get, with the same failure
behavior. Prefer bracket indexing in ordinary code.
Source: lib/typed-map.x:311
MapStringInt.iter
Iter MapStringInt.iter(MapStringInt map, Iter dest)
Initializes dest as a single-pass iterator over boxed values.
The caller owns dest, and the iterator borrows map; both must remain
live during traversal. A null dest returns NULL. Values follow bucket
order, a null map is exhausted, and structural mutation invalidates the
iterator.
Source: lib/typed-map.x:336
MapStringInt.keys
Iter MapStringInt.keys(MapStringInt map, Iter dest)
Initializes dest as a single-pass iterator over boxed keys.
The caller owns dest, and the iterator borrows map; both must remain
live during traversal. A null dest returns NULL. Keys follow bucket
order, a null map is exhausted, and structural mutation invalidates the
iterator. MapIntInt and both String-keyed families box keys without
allocation.
Each MapLongDouble pull allocates its long key as a Var in the current
Scope; the yielded Var and anything retaining it must
not outlive that
Scope.
Raises: MapLongDouble iteration may raise <alloc-fail> or <bad-enc>
while boxing a key.
Source: lib/typed-map.x:336
MapStringInt.len
unsigned MapStringInt.len(MapStringInt map)
Returns the number of entries, or zero for a null map.
Source: lib/typed-map.x:311
MapStringInt.map
Map MapStringInt.map(MapStringInt map)
Returns a fresh ordinary Map containing boxed keys and values. A null input returns NULL. The typed Map and its storage are unchanged.
Raises: any cause from boxing or inserting an entry.
Source: lib/typed-map.x:319
MapStringInt.merge
MapStringInt MapStringInt.merge(MapStringInt map, MapStringInt other)
Copies every entry of other into map and returns the destination.
other wins conflicts. A null other is a no-op; a null destination is
replaced by a fresh map. When a supplied destination fails partway,
entries already copied remain; a newly created destination is discarded.
Raises: an allocation, size, or invariant cause while inserting.
Source: lib/typed-map.x:311
MapStringInt.new
MapStringInt MapStringInt.new(void)
Returns a fresh empty map owned by the current Scope.
The initial table has two buckets and grows automatically.
Raises: <alloc-fail> or <size-limit> when storage cannot be created.
Source: lib/typed-map.x:311
MapStringInt.new_capacity
MapStringInt MapStringInt.new_capacity(unsigned capacity)
Returns a fresh empty map with exactly capacity buckets.
The result and its backing arrays belong to the current Scope.
capacity
must be a power of two of at least two.
Raises: <bad-arg> for another capacity, or <alloc-fail> /
<size-limit> when storage cannot be created.
Source: lib/typed-map.x:311
MapStringInt.postfixindex
int MapStringInt.postfixindex(MapStringInt map, String key, Symbol op)
Applies postfix ++ or -- and returns the previous value.
The key must already exist, and only generated numeric families support
these operations.
Raises: <bad-arg> for a null map or absent key, or <bad-op> for an
unsupported operation. These failures leave the value unchanged.
Source: lib/typed-map.x:311
MapStringInt.repr
String MapStringInt.repr(MapStringInt map)
Returns the readable typed-Map representation.
Source: lib/typed-map.x:319
MapStringInt.set
void MapStringInt.set(MapStringInt map, String key, int val)
Copies key and val into the table, replacing an existing value.
Insertion invalidates live cursors and iterators; replacement does not.
Raises: <bad-arg> for a null map, or an allocation, size, or invariant
cause while inserting. Allocation and size failures leave the table
unchanged.
Source: lib/typed-map.x:311
MapStringInt.setdefault
int MapStringInt.setdefault(MapStringInt map, String key, int defval)
Returns the value for key, inserting defval when absent.
Insertion copies the native key and value fields and invalidates live
cursors and iterators; an existing-key read does not mutate the table.
Raises: <bad-arg> for a null map, or an allocation, size, or invariant
cause while inserting. Allocation and size failures leave the table
unchanged.
Source: lib/typed-map.x:311
MapStringInt.setindex
int MapStringInt.setindex(MapStringInt map, String key, int val)
Stores val under key and returns val.
This is the bracket-facing form of MapStringInt.set, with the same cursor
invalidation and failure behavior.
Source: lib/typed-map.x:311
MapStringInt.str
String MapStringInt.str(MapStringInt map)
Returns the typed-Map display String.
Source: lib/typed-map.x:319
MapStringInt.truth
int MapStringInt.truth(MapStringInt map)
Returns one when map contains an entry.
Source: lib/typed-map.x:311
MapStringInt.try_del
int MapStringInt.try_del(MapStringInt map, String key, int &?out)
Removes key, writes its value to out, and returns one when present.
A null map, null out, or absent key returns zero without writing or
mutation. Successful removal invalidates live cursors and iterators.
Source: lib/typed-map.x:311
MapStringInt.try_get
int MapStringInt.try_get(MapStringInt map, String key, int &?out)
Writes the value for key to out and returns one when present.
A null map, null out, or absent key returns zero without writing.
Source: lib/typed-map.x:311
MapStringInt.try_next
int MapStringInt.try_next(MapStringInt map, unsigned &?cursor, String &?key, int &?val)
Writes the next bucket’s key and value, advances cursor, and returns
one. Initialize the caller-owned cursor to zero. A null argument or
exhaustion returns zero without changing key or val. Traversal
follows bucket order, not insertion order, and structural mutation
invalidates the cursor.
Source: lib/typed-map.x:311
MapStringInt.updateindex
int MapStringInt.updateindex(MapStringInt map, String key, Symbol op, int rhs)
Applies op to the value for key and returns the stored result.
+ inserts rhs when the key is absent; other operations require an
existing key. Supported operations depend on the generated value type.
Raises: <bad-arg> for a null map or missing required key, a cause from
the generated value operation, or an allocation, size, or invariant cause
while inserting. Invalid operations leave an existing value unchanged.
Allocation and size failures leave the table unchanged.
Source: lib/typed-map.x:311
MapStringInt.var
Var MapStringInt.var(MapStringInt map)
Boxes map with its registered typed-map tag without copying it.
The typed pointer and Var share the same mutable map identity.
Source: lib/typed-map.x:336
MapStringInt.write_repr
Buffer MapStringInt.write_repr(MapStringInt map, Buffer out)
Appends the readable typed-Map representation in bucket order.
Source: lib/typed-map.x:319
MapStringInt.write_str
Buffer MapStringInt.write_str(MapStringInt map, Buffer out)
Appends the typed-Map display text in bucket order.
Source: lib/typed-map.x:319
MapStringString
MapStringString.cleanup
void MapStringString.cleanup(MapStringString map)
Releases the record and its backing Blocks, borrowing stored values.
Source: lib/typed-map.x:299
MapStringString.compare
int MapStringString.compare(MapStringString a, MapStringString b)
Compares typed Maps by size and then sorted native key/value contents.
Identical handles compare equal and NULL sorts first. Neither Map is
mutated. Raises: <alloc-fail> while creating temporary storage, or any
cause from key or value comparison.
Source: lib/typed-map.x:281
MapStringString.contains
int MapStringString.contains(MapStringString map, String key)
Returns one when key is present, or zero for a null map.
Source: lib/typed-map.x:273
MapStringString.copy
MapStringString MapStringString.copy(MapStringString map)
Returns a fresh shallow copy in the current Scope.
The result has independent table storage but copies native key and value
fields. A null input produces a fresh empty map.
Raises: an allocation, size, or invariant cause while copying.
Source: lib/typed-map.x:273
MapStringString.del
String MapStringString.del(MapStringString map, String key)
Removes key and returns its value.
Successful removal invalidates live cursors and iterators.
Prefer try_del when absence is an ordinary outcome. Boxed families
return void for absence; native families raise <bad-arg>.
Source: lib/typed-map.x:273
MapStringString.enumerate
Iter MapStringString.enumerate(MapStringString map, Iter dest)
Initializes dest to yield canonical (key value) Lists in bucket
order.
The caller owns dest, and the iterator borrows map; both must remain
live during traversal. A null dest returns NULL, and a null map is
exhausted. Each step boxes both fields and interns two List cells. Each
cell belongs to the pool owning its canonical match, which may be an
ancestor pool, or to the current pool when newly allocated. Structural
mutation invalidates the iterator. Each MapLongDouble pull allocates its
long key as a Var in the current Scope; the yielded List and
anything
retaining it must not outlive that Scope.
Raises: <alloc-fail> or <size-limit> while interning the List, and
for MapLongDouble, <alloc-fail> or <bad-enc> while boxing its key.
Shared causes do not return from the pull.
Source: lib/typed-map.x:299
MapStringString.equal
int MapStringString.equal(MapStringString a, MapStringString b)
Reports key/value equality independent of bucket and insertion order. Two null maps compare equal; a null and a nonnull map compare unequal.
Source: lib/typed-map.x:273
MapStringString.get
String MapStringString.get(MapStringString map, String key)
Returns the value for key.
Prefer try_get when absence is an ordinary outcome. Boxed families
return void for absence; native families raise <bad-arg>.
Source: lib/typed-map.x:273
MapStringString.getdefault
String MapStringString.getdefault(MapStringString map, String key, String defval)
Returns the value for key, or defval without inserting it.
A null map is treated as an empty one.
Source: lib/typed-map.x:273
MapStringString.getindex
String MapStringString.getindex(MapStringString map, String key)
Returns the value selected by bracket indexing.
This is the bracket-facing form of MapStringString.get, with the same failure
behavior. Prefer bracket indexing in ordinary code.
Source: lib/typed-map.x:273
MapStringString.iter
Iter MapStringString.iter(MapStringString map, Iter dest)
Initializes dest as a single-pass iterator over boxed values.
The caller owns dest, and the iterator borrows map; both must remain
live during traversal. A null dest returns NULL. Values follow bucket
order, a null map is exhausted, and structural mutation invalidates the
iterator.
Source: lib/typed-map.x:299
MapStringString.keys
Iter MapStringString.keys(MapStringString map, Iter dest)
Initializes dest as a single-pass iterator over boxed keys.
The caller owns dest, and the iterator borrows map; both must remain
live during traversal. A null dest returns NULL. Keys follow bucket
order, a null map is exhausted, and structural mutation invalidates the
iterator. MapIntInt and both String-keyed families box keys without
allocation.
Each MapLongDouble pull allocates its long key as a Var in the current
Scope; the yielded Var and anything retaining it must
not outlive that
Scope.
Raises: MapLongDouble iteration may raise <alloc-fail> or <bad-enc>
while boxing a key.
Source: lib/typed-map.x:299
MapStringString.len
unsigned MapStringString.len(MapStringString map)
Returns the number of entries, or zero for a null map.
Source: lib/typed-map.x:273
MapStringString.map
Map MapStringString.map(MapStringString map)
Returns a fresh ordinary Map containing boxed keys and values. A null input returns NULL. The typed Map and its storage are unchanged.
Raises: any cause from boxing or inserting an entry.
Source: lib/typed-map.x:281
MapStringString.merge
MapStringString MapStringString.merge(MapStringString map, MapStringString other)
Copies every entry of other into map and returns the destination.
other wins conflicts. A null other is a no-op; a null destination is
replaced by a fresh map. When a supplied destination fails partway,
entries already copied remain; a newly created destination is discarded.
Raises: an allocation, size, or invariant cause while inserting.
Source: lib/typed-map.x:273
MapStringString.new
MapStringString MapStringString.new(void)
Returns a fresh empty map owned by the current Scope.
The initial table has two buckets and grows automatically.
Raises: <alloc-fail> or <size-limit> when storage cannot be created.
Source: lib/typed-map.x:273
MapStringString.new_capacity
MapStringString MapStringString.new_capacity(unsigned capacity)
Returns a fresh empty map with exactly capacity buckets.
The result and its backing arrays belong to the current Scope.
capacity
must be a power of two of at least two.
Raises: <bad-arg> for another capacity, or <alloc-fail> /
<size-limit> when storage cannot be created.
Source: lib/typed-map.x:273
MapStringString.postfixindex
String MapStringString.postfixindex(MapStringString map, String key, Symbol op)
Applies postfix ++ or -- and returns the previous value.
The key must already exist, and only generated numeric families support
these operations.
Raises: <bad-arg> for a null map or absent key, or <bad-op> for an
unsupported operation. These failures leave the value unchanged.
Source: lib/typed-map.x:273
MapStringString.repr
String MapStringString.repr(MapStringString map)
Returns the readable typed-Map representation.
Source: lib/typed-map.x:281
MapStringString.set
void MapStringString.set(MapStringString map, String key, String val)
Copies key and val into the table, replacing an existing value.
Insertion invalidates live cursors and iterators; replacement does not.
Raises: <bad-arg> for a null map, or an allocation, size, or invariant
cause while inserting. Allocation and size failures leave the table
unchanged.
Source: lib/typed-map.x:273
MapStringString.setdefault
String MapStringString.setdefault(MapStringString map, String key, String defval)
Returns the value for key, inserting defval when absent.
Insertion copies the native key and value fields and invalidates live
cursors and iterators; an existing-key read does not mutate the table.
Raises: <bad-arg> for a null map, or an allocation, size, or invariant
cause while inserting. Allocation and size failures leave the table
unchanged.
Source: lib/typed-map.x:273
MapStringString.setindex
String MapStringString.setindex(MapStringString map, String key, String val)
Stores val under key and returns val.
This is the bracket-facing form of MapStringString.set, with the same cursor
invalidation and failure behavior.
Source: lib/typed-map.x:273
MapStringString.str
String MapStringString.str(MapStringString map)
Returns the typed-Map display String.
Source: lib/typed-map.x:281
MapStringString.truth
int MapStringString.truth(MapStringString map)
Returns one when map contains an entry.
Source: lib/typed-map.x:273
MapStringString.try_del
int MapStringString.try_del(MapStringString map, String key, String &?out)
Removes key, writes its value to out, and returns one when present.
A null map, null out, or absent key returns zero without writing or
mutation. Successful removal invalidates live cursors and iterators.
Source: lib/typed-map.x:273
MapStringString.try_get
int MapStringString.try_get(MapStringString map, String key, String &?out)
Writes the value for key to out and returns one when present.
A null map, null out, or absent key returns zero without writing.
Source: lib/typed-map.x:273
MapStringString.try_next
int MapStringString.try_next(MapStringString map, unsigned &?cursor, String &?key, String &?val)
Writes the next bucket’s key and value, advances cursor, and returns
one. Initialize the caller-owned cursor to zero. A null argument or
exhaustion returns zero without changing key or val. Traversal
follows bucket order, not insertion order, and structural mutation
invalidates the cursor.
Source: lib/typed-map.x:273
MapStringString.updateindex
String MapStringString.updateindex(MapStringString map, String key, Symbol op, String rhs)
Applies op to the value for key and returns the stored result.
+ inserts rhs when the key is absent; other operations require an
existing key. Supported operations depend on the generated value type.
Raises: <bad-arg> for a null map or missing required key, a cause from
the generated value operation, or an allocation, size, or invariant cause
while inserting. Invalid operations leave an existing value unchanged.
Allocation and size failures leave the table unchanged.
Source: lib/typed-map.x:273
MapStringString.var
Var MapStringString.var(MapStringString map)
Boxes map with its registered typed-map tag without copying it.
The typed pointer and Var share the same mutable map identity.
Source: lib/typed-map.x:299
MapStringString.write_repr
Buffer MapStringString.write_repr(MapStringString map, Buffer out)
Appends the readable typed-Map representation in bucket order.
Source: lib/typed-map.x:281
MapStringString.write_str
Buffer MapStringString.write_str(MapStringString map, Buffer out)
Appends the typed-Map display text in bucket order.
Source: lib/typed-map.x:281
Var
Var.mapintint
MapIntInt Var.mapintint(Var value)
Returns the typed-map pointer carried by value.
value must carry this family’s registered tag; the converter does
not validate the tag before reading its pointer payload.
Source: lib/typed-map.x:241
Var.maplongdouble
MapLongDouble Var.maplongdouble(Var value)
Returns the typed-map pointer carried by value.
value must carry this family’s registered tag; the converter does
not validate the tag before reading its pointer payload.
Source: lib/typed-map.x:261
Var.mapstringint
MapStringInt Var.mapstringint(Var value)
Returns the typed-map pointer carried by value.
value must carry this family’s registered tag; the converter does
not validate the tag before reading its pointer payload.
Source: lib/typed-map.x:336
Var.mapstringstring
MapStringString Var.mapstringstring(Var value)
Returns the typed-map pointer carried by value.
value must carry this family’s registered tag; the converter does
not validate the tag before reading its pointer payload.
Source: lib/typed-map.x:299
Public types
| Type | Kind | Summary |
|---|---|---|
MapIntInt | struct | A mutable, Scope-owned map from native int keys to int values. |
MapLongDouble | struct | A mutable, Scope-owned map from native long keys to double values. |
MapStringInt | struct | A mutable, Scope-owned map from canonical String keys to native int values. |
MapStringString | struct | A mutable, Scope-owned map from canonical Strings to canonical Strings. |
MapIntInt
typedef struct MapIntInt { Scope scope, Bytes hashes, entries; unsigned used; unsigned capacity; unsigned mask; } *MapIntInt
A mutable, Scope-owned map from native int keys to int values.
Keys and values are copied into native entry fields; assignment shares the
map, while MapIntInt.copy makes an independent table. Compound indexed
updates support arithmetic, remainder, bitwise, and shift operators, plus
postfix increment and decrement.
Source: lib/typed-map.x:27
MapLongDouble
typedef struct MapLongDouble { Scope scope, Bytes hashes, entries; unsigned used; unsigned capacity; unsigned mask; } *MapLongDouble
A mutable, Scope-owned map from native long keys to double values.
Keys and values are copied into native entry fields; assignment shares the
map, while MapLongDouble.copy makes an independent table. Compound
indexed updates support +, -, *, and /, plus postfix increment and
decrement.
Source: lib/typed-map.x:40
MapStringInt
typedef struct MapStringInt { Scope scope, Bytes hashes, entries; unsigned used; unsigned capacity; unsigned mask; } *MapStringInt
A mutable, Scope-owned map from canonical String keys to native int
values. Exporting an owned map rebuilds it with destination-canonical keys
before replacing its storage. Compound indexed updates support arithmetic,
remainder, bitwise, and shift operators, plus postfix increment and
decrement.
Source: lib/typed-map.x:70
MapStringString
typedef struct MapStringString { Scope scope, Bytes hashes, entries; unsigned used; unsigned capacity; unsigned mask; } *MapStringString
A mutable, Scope-owned map from canonical Strings to canonical
Strings.
The native entry fields borrow the supplied String pointers. Exporting a
map owned by a Context recanonicalizes only Strings owned by that
Context
in the destination pool before moving the map. Borrowed or outer-owned
Strings retain their existing pool lifetime, which must outlive the map.
Compound indexed update supports only concatenation; postfix update is
unsupported.
Source: lib/typed-map.x:57
Design notes
These optional families store keys and values in native record fields.
Their static operations do not box through Var. Separate methods provide
Var conversion and Iter traversal.
Tests and examples
make verify (unittest/test-typed-map.x).