protected void delete_object(final ETuple obj) {
in_tx(new WithMap<Object>() {
@Override
protected Object run(IPersistentMap map) {
EObject key = get_key(obj);
IPersistentCollection empty = empty();
IPersistentCollection c =
(IPersistentCollection) map.valAt(key, empty);
if (c == null || c.count()==0)
return null;
IPersistentCollection out = empty();
int deleted = 0;
for (ISeq s = c.seq(); s != null; s = s.next()) {
EObject val = (EObject) s.first();
if (val == null) break;
if (! obj.equalsExactly(val)) {
out = out.cons(val);
} else {
deleted += 1;
}
}
if (out.count() == 0) {
try {
map = map.without(key);
} catch (Exception e) {
throw new Error(e);
}