gather initialization goals and call them once load succeeds (#792)

This commit is contained in:
Mark Thom
2021-02-05 18:40:13 -07:00
parent bbbf95705b
commit a104b35cea
6 changed files with 14 additions and 28 deletions

View File

@@ -1789,22 +1789,6 @@ impl Machine {
self.machine_st.fail = true;
}
pub(crate)
fn compile_pending_predicates(&mut self) {
let (mut loader, evacuable_h) = self.loader_from_heap_evacuable(temp_v!(1));
let compile_pending_predicates = || {
if !loader.predicates.is_empty() {
loader.compile_and_submit()?;
}
LiveTermStream::evacuate(loader)
};
let result = compile_pending_predicates();
self.restore_load_state_payload(result, evacuable_h);
}
}
impl<'a> Loader<'a, LiveTermStream> {

View File

@@ -524,7 +524,6 @@ pub enum REPLCodePtr {
MultifileProperty,
DiscontiguousProperty,
DynamicProperty,
CompilePendingPredicates,
AbolishClause,
Asserta,
Assertz,

View File

@@ -491,9 +491,6 @@ impl Machine {
REPLCodePtr::DynamicProperty => {
self.dynamic_property();
}
REPLCodePtr::CompilePendingPredicates => {
self.compile_pending_predicates();
}
REPLCodePtr::Assertz => {
self.compile_assert(AppendOrPrepend::Append);
}