Next: Amap mapping and folding, Previous: Amap accessors, Up: Associative Maps [Contents][Index]
Repeatedly mutates amap, creating new associations in it by processing the arguments from left to right. The args alternate between keys and values. Whenever there is a previous association for a key, it is deleted. It is an error if a key does not satisfy the type check procedure of the comparator of amap. Likewise, it is an error if a key is not a valid argument to the equality predicate of amap. Returns an unspecified value.
Deletes any association to each key in amap and returns the number of keys that had associations.
Effectively invokes amap-ref
with the given arguments and
returns what it returns. If key was not found in amap,
its value is set to the result of calling fail.
Semantically equivalent to, but may be more efficient than, the following code:
(amap-set! amap key (updater (amap-ref amap key fail succeed)))
Semantically equivalent to, but may be more efficient than, the following code:
(amap-set! amap key (updater (amap-ref/default amap key default)))
Chooses an arbitrary association from amap and removes it, returning the key and value as two values. Signals an error if amap is empty.
Delete all the associations from amap.
If amap has weak or ephemeral associations, cleans up any storage for associations whose key and/or value has been reclaimed by the garbage collector. Otherwise does nothing.
This procedure does not have any visible effect, since the associations it cleans up are ignored by all other parts of the interface. Additionally, most implementations clean up their storage incrementally as they are used. But this procedure provides for edge cases where the reclaimed storage might matter.
Next: Amap mapping and folding, Previous: Amap accessors, Up: Associative Maps [Contents][Index]