(rontolisp) docs
← State

compare-and-set!

(compare-and-set! atom expected v)

When the atom's value compares equal to expected, stores v; answers true or false either way, the new value read back through deref. The comparison is eql: numbers by value, everything else by identity.