This one is buggy
?- merge_options( [max_depth(100),quoted(true),portray(true),max_depth(10),attributes(portray)], [max_depth(100),quoted(true),portray(true),max_depth(10),attributes(portray)],M). M = [attributes(portray),max_depth(10),max_depth(100),portray(true),quoted(true)].
As the order of options is important (first one found wins) I would expect the relative order of options with the same functor to be kept (what if there is a conflict among the order of the same-functored entries in the two lists? one could state that the orderingof New wins)
Instead the options are sorted according to the standard order of terms.
Need one to "collapse options"
One would wish to:
?- collapse_options( [max_depth(100),quoted(true),portray(true),max_depth(10),attributes(portray)],C). C = [max_depth(100),quoted(true),portray(true),attributes(portray)]