I was thinking maybe the following could improve usability on dicts using the functionality that we already have with select_dict/3.
- To allow partial unification in the head using this syntax:
mypred( mydict{ key1: Val1, key2: Val2, ...} ) :-
% here the head will unify with any DictIn for which
% select_dict(mydict{key1 : Val1, key2: Val2 }, DictIn, _) succeeds
%
- To allow for the same kind of notation in goals, like
mypred(SomeVar ) :-
% The next line is the same as writing:
% select_dict(mydict{key1 : Val1, key2: Val2 }, SomeVar, _)
SomeVar = mydict{key1: Val1, key2: Val2, ...};
% the following line would produce exacly the same select_dict/3 call
mydict{key1: Val1, key2: Val2, ... } = SomeVar.
It seems to me this solves the major usability frictions that are found with dicts. Any thoughts?