protocol
dictionaryp
ï
Dictionary protocol.
logtalk_load(dictionaries(loader))
static
Public predicatesï
as_dictionary/2
ï
Converts a list of key-value pairs to a dictionary.
static
as_dictionary(Pairs,Dictionary)
as_dictionary(@list(pairs),-dictionary)
- one
as_list/2
ï
Converts a dictionary to an ordered list (as per standard order) of key-value pairs.
static
as_list(Dictionary,Pairs)
as_list(@dictionary,-list(pairs))
- one
as_curly_bracketed/2
ï
Creates a curly-bracketed term representation of a dictionary.
static
as_curly_bracketed(Dictionary,Term)
as_curly_bracketed(+dictionary,--term)
- one
clone/3
ï
Clones a dictionary using the same keys but with all values unbound and returning a list of all the pairs in the new clone.
static
clone(Dictionary,Clone,ClonePairs)
clone(+dictionary,-dictionary,-list(pairs))
- one
clone/4
ï
Clones a dictionary using the same keys but with all values unbound and returning the list of all pairs in the dictionary and in the clone.
static
clone(Dictionary,Pairs,Clone,ClonePairs)
clone(+dictionary,-list(pairs),-dictionary,-list(pairs))
- one
insert/4
ï
Inserts a key-value pair into a dictionary, returning the updated dictionary. When the key already exists, the associated value is updated.
static
insert(OldDictionary,Key,Value,NewDictionary)
insert(+dictionary,+ground,@term,-dictionary)
- one
delete/4
ï
Deletes a matching key-value pair from a dictionary, returning the updated dictionary. Fails if it cannot find the key or if the key exists but the value does not unify.
static
delete(OldDictionary,Key,Value,NewDictionary)
delete(+dictionary,@ground,?term,-dictionary)
- zero_or_one
update/4
ï
Updates the value associated with Key in a dictionary, returning the updated dictionary. Fails if it cannot find the key.
static
update(OldDictionary,Key,NewValue,NewDictionary)
update(+dictionary,@ground,+term,-dictionary)
- zero_or_one
update/5
ï
Updates the value associated with a key in a dictionary, returning the updated dictionary. Fails if it cannot find the key or if the existing value does not unify.
static
update(OldDictionary,Key,OldValue,NewValue,NewDictionary)
update(+dictionary,@ground,?term,+term,-dictionary)
- zero_or_one
update/3
ï
Updates the key-value pairs in a dictionary, returning the updated dictionary. Fails if it cannot find one of the keys.
static
update(OldDictionary,Pairs,NewDictionary)
update(+dictionary,@list(pair),-dictionary)
- zero_or_one
empty/1
ï
True iff the dictionary is empty.
static
empty(Dictionary)
empty(@dictionary)
- zero_or_one
lookup/3
ï
Lookups a matching key-value pair from a dictionary. Fails if no match is found.
static
lookup(Key,Value,Dictionary)
lookup(+ground,?term,@dictionary)
- zero_or_one
lookup(-ground,?term,@dictionary)
- zero_or_more
lookup/2
ï
Lookups all matching key-value pairs from a dictionary. Fails if it cannot find one of the keys or if a value for a key does not unify.
static
lookup(Pairs,Dictionary)
lookup(+list(pair),@dictionary)
- zero_or_one
intersection/2
ï
True iff the values of the dictionaries common keys unify. Trivially true when there are no common keys.
static
intersection(Dictionary1,Dictionary2)
intersection(+dictionary,+dictionary)
- zero_or_one
intersection/3
ï
Returns the (possibly empty) intersection between two dictionaries when the values of their common keys unify.
static
intersection(Dictionary1,Dictionary2,Intersection)
intersection(+dictionary,+dictionary,-dictionary)
- zero_or_one
previous/4
ï
Returns the previous pair in a dictionary given a key. Fails if there is no previous pair.
static
previous(Dictionary,Key,Previous,Value)
previous(+dictionary,+key,-key,-value)
- zero_or_one
next/4
ï
Returns the next pair in a dictionary given a key. Fails if there is no next pair.
static
next(Dictionary,Key,Next,Value)
next(+dictionary,+key,-key,-value)
- zero_or_one
min/3
ï
Returns the pair with the minimum key (as per standard order) in a dictionary. Fails if the dictionary is empty.
static
min(Dictionary,Key,Value)
min(+dictionary,-key,-value)
- zero_or_one
max/3
ï
Returns the pair with the maximum key (as per standard order) in a dictionary. Fails if the dictionary is empty.
static
max(Dictionary,Key,Value)
max(+dictionary,-key,-value)
- zero_or_one
delete_min/4
ï
Deletes the pair with the minimum key (as per standard order) from a dictionary, returning the deleted pair and the updated dictionary. Fails if the dictionary is empty.
static
delete_min(OldDictionary,Key,Value,NewDictionary)
delete_min(+dictionary,-key,-value,-dictionary)
- zero_or_one
delete_max/4
ï
Deletes the pair with the maximum key (as per standard order) from a dictionary, returning the deleted pair and the updated dictionary. Fails if the dictionary is empty.
static
delete_max(OldDictionary,Key,Value,NewDictionary)
delete_max(+dictionary,-key,-value,-dictionary)
- zero_or_one
keys/2
ï
Returns a list with all the dictionary keys in ascending order (as per standard order).
static
keys(Dictionary,Keys)
keys(@dictionary,-list)
- one
values/2
ï
Returns a list with all the dictionary values in ascending order of the keys (as per standard order).
static
values(Dictionary,Values)
values(@dictionary,-list)
- one
map/2
ï
Maps a closure over each dictionary key-value pair. Fails if the mapped closure attempts to modify the keys.
static
map(Closure,Dictionary)
map(1,*)
map(@callable,+dictionary)
- zero_or_more
map/3
ï
Maps a closure over each dictionary key-value pair, returning the new dictionary. Fails if the mapped closure attempts to modify the keys.
static
map(Closure,OldDictionary,NewDictionary)
map(2,*,*)
map(@callable,+dictionary,-dictionary)
- zero_or_more
apply/4
ï
Applies a closure to a specific key-value pair, returning the new dictionary. Fails if the key cannot be found or if the mapped closure attempts to modify the key.
static
apply(Closure,OldDictionary,Key,NewDictionary)
apply(2,*,*,*)
apply(+callable,+dictionary,+key,-dictionary)
- zero_or_one
size/2
ï
Number of dictionary entries.
static
size(Dictionary,Size)
size(@dictionary,?integer)
- one
Protected predicatesï
(none)
Private predicatesï
(none)
Operatorsï
(none)