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.