correct abolish/1
This commit is contained in:
@@ -566,7 +566,7 @@ abolish(Pred) :-
|
|||||||
; Arity < 0 -> throw(domain_error(not_less_than_zero, Arity), abolish/1)
|
; Arity < 0 -> throw(domain_error(not_less_than_zero, Arity), abolish/1)
|
||||||
; max_arity(N), Arity > N -> throw(representation_error(max_arity), abolish/1)
|
; max_arity(N), Arity > N -> throw(representation_error(max_arity), abolish/1)
|
||||||
; functor(Head, Name, Arity) ->
|
; 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)
|
; '$head_is_dynamic'(Head) -> '$abolish_clause'(Name, Arity)
|
||||||
; throw(error(permission_error(modify, static_procedure, Pred), abolish/1))
|
; throw(error(permission_error(modify, static_procedure, Pred), abolish/1))
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -69,8 +69,7 @@ impl Machine {
|
|||||||
set_code_index!(idx, IndexPtr::Undefined, clause_name!("user"));
|
set_code_index!(idx, IndexPtr::Undefined, clause_name!("user"));
|
||||||
}
|
}
|
||||||
|
|
||||||
self.indices.code_dir.remove(&(name.clone(), arity));
|
self.indices.remove_code_index((name, arity));
|
||||||
self.indices.dynamic_code_dir.remove(&(name, arity));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_eval_result_from_dynamic_compile(&mut self, pred_str: String, name: ClauseName,
|
fn handle_eval_result_from_dynamic_compile(&mut self, pred_str: String, name: ClauseName,
|
||||||
|
|||||||
@@ -103,11 +103,8 @@ impl SubModuleUser for IndexStore {
|
|||||||
|
|
||||||
fn remove_code_index(&mut self, key: PredicateKey)
|
fn remove_code_index(&mut self, key: PredicateKey)
|
||||||
{
|
{
|
||||||
self.code_dir.remove(&key);
|
self.code_dir.remove(&key);
|
||||||
|
self.dynamic_code_dir.remove(&key);
|
||||||
if self.dynamic_code_dir.contains_key(&key) {
|
|
||||||
self.dynamic_code_dir.remove(&key);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn insert_dir_entry(&mut self, name: ClauseName, arity: usize, idx: ModuleCodeIndex)
|
fn insert_dir_entry(&mut self, name: ClauseName, arity: usize, idx: ModuleCodeIndex)
|
||||||
|
|||||||
Reference in New Issue
Block a user