Method m_delete()
- Method
m_delete
mixedm_delete(object|mapping|multisetmap,mixedindex,mixed|voidexpected)- Description
If
mapis an object that implements lfun::_m_delete(), that function will be called withindexas its single argument.Otherwise if
mapis a mapping or multiset the entry with indexindexwill be removed frommapdestructively.If the mapping or multiset does not have an entry with index
index, nothing is done.If
expectedhas been specified, the entry will only be removed if its value matches (with `==()).- Returns
The value that was removed will be returned, and
UNDEFINEDotherwise.- Note
Note that m_delete() changes
mapdestructively.- Note
The third argument (
expected) was added in Pike 9.0, and can be used for atomic test and unset.- See also