masarati@aero.polimi.it wrote:
I need to implement a modify operation whose semantics is "add if not present", an add that only takes place if that attribute is not yet present in the entry.
I need it as an internal operation, so right now I wouldn't bother formalizing it as an extension of the semantics of the modify operation. Something like the SLAP_MOD_SOFTADD, which in turn consists in adding an attribute value only if that value is not already present.
I'd introduce a SLAP_MOD_ADD_IF_NOT_PRESENT flag and add code to support it in all (well, most) backends/overlays that need to muck with modify operation type.
Sounds like you could do it with an Assertion Control (!(attr=*)).