dict_fill/4

Did you know ... Search Documentation:
SWI-Prolog owl logo Predicate dict_fill/4
Availability::- use_module(library(dicts)).(can be autoloaded)
Source [det]dict_fill(+ValueIn, +Key, +Dict, -Value)
Implementation for the dicts_to_same_keys/3 OnEmpty closure that fills new cells with a copy of ValueIn. Note that copy_term/2 does not really copy ground terms. Below are two examples. Note that when filling empty cells with a variable, each empty cell is bound to a new variable.
?- dicts_to_same_keys([r{x:1}, r{y:2}], dict_fill(null), L).
L = [r{x:1, y:null}, r{x:null, y:2}].
?- dicts_to_same_keys([r{x:1}, r{y:2}], dict_fill(_), L).
L = [r{x:1, y:_G2005}, r{x:_G2036, y:2}].

Use dict_no_fill/3 to raise an error if a dict is missing a key.

Tags are associated to your profile if you are logged in
Tags:
login to add a new annotation post.

AltStyle によって変換されたページ (->オリジナル) /