current_input(Stream),
read(Stream, Term).
-% term_variables.
-
% ensures List is either a variable or a list.
can_be_list(List, _) :-
var(List),
can_be_list(List, PI) :-
throw(error(type_error(list, List), PI)).
+% term_variables.
+
term_variables(Term, Vars) :-
can_be_list(Vars, term_variables/2),
'$term_variables'(Term, Vars).
; throw(error(instantiation_error, PI))
).
-can_be_chars_or_vars(Cs, _) :- var(Cs), !.
+can_be_chars_or_vars(Cs, _) :- var(Cs), !.
can_be_chars_or_vars(Cs, PI) :- chars_or_vars(Cs, PI).
chars_or_vars([], _).
chars_or_vars([C|Cs], PI) :-
( nonvar(C) ->
- ( catch(builtins:atom_length(C, 1), _, false) ->
+ ( atom(C),
+ atom_length(C, 1) ->
( nonvar(Cs) ->
chars_or_vars(Cs, PI)
; false
indices: &IndexStore,
stub_gen: impl Fn() -> FunctorStub,
) -> CallResult {
- let nx = self.registers[2];
+ let nx = self.store(self.deref(self.registers[2]));
if let Some(c) = string.chars().last() {
if layout_char!(c) {