protocol

dictionaryp

Dictionary protocol.

author:
Paulo Moura
version:
1.0
date:
2000/7/24
compilation:
static

(no dependencies on other files)

Public interface

as_dictionary/2

Converts a list of key-value pairs to a dictionary.

compilation:
static
template:
as_dictionary(List, Dictionary)
mode – number of solutions:
as_dictionary(@list, -dictionary) – one

as_list/2

Converts a dictionary to a list of key-value pairs.

compilation:
static
template:
as_list(Dictionary, List)
mode – number of solutions:
as_list(@dictionary, -list) – one

delete/4

Deletes a matching Key-Value pair from a dictionary, returning the updated dictionary.

compilation:
static
template:
delete(Dictionary_in, Key, Value, Dictionary_out)
mode – number of solutions:
delete(+dictionary, @ground, ?term, -dictionary) – zero_or_one

empty/1

True if the dictionary is empty.

compilation:
static
template:
empty(Dictionary)
mode – number of solutions:
empty(@dictionary) – zero_or_one

insert/4

Inserts a Key-Value pair into a dictionary, returning the updated dictionary.

compilation:
static
template:
insert(Key, Value, Dictionary_in, Dictionary_out)
mode – number of solutions:
insert(+ground, @term, +dictionary, -dictionary) – one

insert_all/3

Inserts a list of Key-Value pairs into a dictionary, returning the updated dictionary.

compilation:
static
template:
insert_all(List, Dictionary_in, Dictionary_out)
mode – number of solutions:
insert_all(@list, +dictionary, -dictionary) – one

lookup/3

Get a matching Key-Value pair from a dictionary.

compilation:
static
template:
lookup(Key, Value, Dictionary)
mode – number of solutions:
lookup(+ground, ?term, @dictionary) – zero_or_one
lookup(-ground, ?term, @dictionary) – zero_or_more

keys/2

Returns a list with all dictionary keys.

compilation:
static
template:
keys(Dictionary, List)
mode – number of solutions:
keys(@dictionary, -list) – one

map/3

Maps a binary predicate over each dictionary key-value pair returning a new pair.

compilation:
static
template:
map(Functor, In, Out)
mode – number of solutions:
map(+functor, +dictionary, -dictionary) – zero_or_one

size/2

Number of dictionary entries.

compilation:
static
template:
size(Dictionary, Size)
mode – number of solutions:
size(@dictionary, ?integer) – zero_or_one

Protected interface

(none)

Private predicates

(none)

Remarks

(none)