; Arity < 0 -> throw(domain_error(not_less_than_zero, Arity), abolish/1)
; max_arity(N), Arity > N -> throw(representation_error(max_arity), abolish/1)
; functor(Head, Name, Arity) ->
- ( '$no_such_predicate'(Head) -> true
+ ( '$no_such_predicate'(Head) -> '$abolish_clause'(Name, Arity)
; '$head_is_dynamic'(Head) -> '$abolish_clause'(Name, Arity)
; throw(error(permission_error(modify, static_procedure, Pred), abolish/1))
)
set_code_index!(idx, IndexPtr::Undefined, clause_name!("user"));
}
- self.indices.code_dir.remove(&(name.clone(), arity));
- self.indices.dynamic_code_dir.remove(&(name, arity));
+ self.indices.remove_code_index((name, arity));
}
fn handle_eval_result_from_dynamic_compile(&mut self, pred_str: String, name: ClauseName,
fn remove_code_index(&mut self, key: PredicateKey)
{
- self.code_dir.remove(&key);
-
- if self.dynamic_code_dir.contains_key(&key) {
- self.dynamic_code_dir.remove(&key);
- }
+ self.code_dir.remove(&key);
+ self.dynamic_code_dir.remove(&key);
}
fn insert_dir_entry(&mut self, name: ClauseName, arity: usize, idx: ModuleCodeIndex)