5.4.2 Predicates for managing dicts
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • SWI-Prolog extensions
        • Dicts: structures with named arguments
          • Predicates for managing dicts
            • is_dict/1
            • is_dict/2
            • get_dict/3
            • get_dict/5
            • dict_create/3
            • dict_pairs/3
            • put_dict/3
            • put_dict/4
            • del_dict/4
            • :</2
            • select_dict/3
            • >:</2
            • Destructive assignment in dicts
    • Packages
Availability:built-in
[semidet]get_dict(+Key, +Dict, -Value, -NewDict, +NewValue)
Create a new dict after updating the value for Key. Fails if Value does not unify with the current value associated with Key. Dict is either a dict or a list the can be converted into a dict.

Has the behavior as if defined in the following way:

get_dict(Key, Dict, Value, NewDict, NewValue) :-
        get_dict(Key, Dict, Value),
        put_dict(Key, Dict, NewValue, NewDict).