bb_update/3
bb_update(:Key, -OldTerm, +NewTerm)
If a term is currently stored under Key and unifies with
OldTerm, the term is replaced by a copy of NewTerm.
Otherwise, bb_update/3
silently fails. This predicate provides
an atomic swap operation.
bbkey
term
term
Any uninstantiated variables in the NewTerm will be replaced by new private variables, along with copies of any subgoals blocked on these variables (see ref-sem-sec).
instantiation_error
Key is not instantiated
type_error
Key is not an atom or a small integer.