Skip to content

Commit

Permalink
filter our builtins from current_predicate/1 (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
mthom committed Sep 26, 2023
1 parent 5699257 commit 2efe95f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/machine/system_calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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!("/"),
Expand Down

1 comment on commit 2efe95f

@pmoura
Copy link
Contributor

@pmoura pmoura commented on 2efe95f Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

% logtalk/tests/prolog/predicates/current_predicate_1
%         21 tests: 0 skipped, 21 passed, 0 failed (0 flaky)
%         completed tests from object tests in 2 seconds
%         clause coverage n/a

Please sign in to comment.