change the semantics of put_atts/2 to better reflect those of SICSTus

This commit is contained in:
Mark Thom
2019-03-12 18:45:42 -06:00
parent a6d3f39152
commit 2af08b31d2
4 changed files with 44 additions and 53 deletions

View File

@@ -106,8 +106,10 @@ put_attr(Name, Arity) -->
{ functor(Attr, Name, Arity),
numbervars(Attr, 0, Arity),
V = '$VAR'(Arity) },
[(put_atts(V, +Attr) :- !, functor(Attr, _, _), '$put_attr'(V, Attr)),
(put_atts(V, Attr) :- !, functor(Attr, _, _), '$put_attr'(V, Attr)),
[(put_atts(V, +Attr) :- !, functor(Attr, Head, Arity), functor(AttrForm, Head, Arity),
'$get_attr_list'(V, Ls), '$del_attr'(Ls, V, AttrForm), '$put_attr'(V, Attr)),
(put_atts(V, Attr) :- !, functor(Attr, Head, Arity), functor(AttrForm, Head, Arity),
'$get_attr_list'(V, Ls), '$del_attr'(Ls, V, AttrForm), '$put_attr'(V, Attr)),
(put_atts(V, -Attr) :- !, functor(Attr, _, _), '$get_attr_list'(V, Ls), '$del_attr'(Ls, V, Attr))].
get_attr(Name, Arity) -->