Eyal Dechter: The YAP version of assoc.pl has gen_assoc(Assoc, Key, Value). Both SWI and Sicstus use gen_assoc(Key, Assoc, Value). Could it be changed for compatibility with the other systems?
This commit is contained in:
parent
0e58a8f41e
commit
56024b2a2c
@ -130,14 +130,14 @@ the associated value.
|
|||||||
max_assoc(T,K,V) :-
|
max_assoc(T,K,V) :-
|
||||||
rb_max(T,K,V).
|
rb_max(T,K,V).
|
||||||
|
|
||||||
/** @pred gen_assoc(+ _Assoc_,? _Key_,? _Value_)
|
/** @pred gen_assoc( ?Key, +Assoc, ?Valu_)
|
||||||
|
|
||||||
|
|
||||||
Given the association list _Assoc_, unify _Key_ and _Value_
|
Given the association list _Assoc_, unify _Key_ and _Value_
|
||||||
with two associated elements. It can be used to enumerate all elements
|
with a key-value pair in the list. It can be used to enumerate all elements
|
||||||
in the association list.
|
in the association list.
|
||||||
*/
|
*/
|
||||||
gen_assoc(T,K,V) :-
|
gen_assoc(K, T, V) :-
|
||||||
rb_in(K,V,T).
|
rb_in(K,V,T).
|
||||||
|
|
||||||
/** @pred get_assoc(+ _Key_,+ _Assoc_,? _Value_)
|
/** @pred get_assoc(+ _Key_,+ _Assoc_,? _Value_)
|
||||||
|
Reference in New Issue
Block a user