]> Repositorios git - scryer-prolog.git/commitdiff
filter our builtins from current_predicate/1 (#153)
authorMark <[email protected]>
Tue, 26 Sep 2023 19:46:21 +0000 (13:46 -0600)
committerMark <[email protected]>
Tue, 26 Sep 2023 19:46:21 +0000 (13:46 -0600)
src/machine/system_calls.rs

index 4a54ad911090e35cb63e2a5f49d69a9323fd53be..34b26808d5603e0c41a25cea960e783035c4a42a 100644 (file)
@@ -3908,6 +3908,11 @@ impl Machine {
             }
         );
 
+        if self.indices.builtin_property((name, arity)) {
+            self.machine_st.fail = true;
+            return;
+        }
+
         self.machine_st.fail = self
             .indices
             .get_predicate_code_index(name, arity, module_name)
@@ -3987,6 +3992,10 @@ impl Machine {
         };
 
         for (name, arity) in code_dir.keys() {
+            if self.indices.builtin_property((*name, *arity)) {
+                continue;
+            }
+
             if name_match(pred_atom, *name) && arity_match(pred_arity, *arity) {
                 self.machine_st.heap.extend(functor!(
                     atom!("/"),