% It can be used to check for existence of a predicate or to enumerate all loaded predicates
current_predicate(Pred) :-
( var(Pred) ->
- '$get_db_refs'(_, _, PIs),
+ '$get_db_refs'(_, _, _, PIs),
lists:member(Pred, PIs)
; '$strip_module'(Pred, Module, UnqualifiedPred),
( var(Module),
\+ functor(Pred, (:), 2)
; atom(Module)
),
- nonvar(UnqualifiedPred),
UnqualifiedPred = Name/Arity ->
( ( nonvar(Name), \+ atom(Name)
; nonvar(Arity), \+ integer(Arity)
file_exists/1,
directory_exists/1,
delete_file/1,
- rename_file/2,
- file_copy/2,
- delete_directory/1,
+ rename_file/2,
+ file_copy/2,
+ delete_directory/1,
make_directory/1,
make_directory_path/1,
working_directory/2,
setup_call_cleanup/3,
call_nth/2,
copy_term_nat/2,
- asserta/2,
- assertz/2]).
+ asserta/2,
+ assertz/2]).
:- use_module(library(error), [can_be/2,
domain_error/3,
(HeapCellValueTag::Atom, (module_name, _arity)) => {
module_name
}
- (HeapCellValueTag::AttrVar | HeapCellValueTag::Var) => {
+ (HeapCellValueTag::AttrVar | HeapCellValueTag::Var | HeapCellValueTag::StackVar) => {
atom!("user")
}
_ => {
(0 .. num_functors).map(|i| str_loc_as_cell!(h + 3 * i)),
);
- unify!(self.machine_st, heap_loc_as_cell!(h), self.machine_st.registers[3]);
+ unify!(self.machine_st, heap_loc_as_cell!(h), self.machine_st.registers[4]);
} else {
- unify!(self.machine_st, empty_list_as_cell!(), self.machine_st.registers[3]);
+ unify!(self.machine_st, empty_list_as_cell!(), self.machine_st.registers[4]);
}
}