Skip to content

Commit bc616ca

Browse files
committed
move call_residue_vars/2 from atts.pl to iso_ext.pl
1 parent 9913113 commit bc616ca

File tree

6 files changed

+15
-17
lines changed

6 files changed

+15
-17
lines changed

src/lib/atts.pl

-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
:- module(atts, [op(1199, fx, attribute),
2-
call_residue_vars/2,
32
term_attributed_variables/2]).
43

54
:- use_module(library(dcgs)).
@@ -111,13 +110,5 @@
111110
nonvar(Term),
112111
Term = get_atts(Var, M, Attr).
113112

114-
:- meta_predicate call_residue_vars(0, ?).
115-
116-
call_residue_vars(Goal, Vars) :-
117-
can_be(list, Vars),
118-
'$get_attr_var_queue_delim'(B),
119-
call(Goal),
120-
'$get_attr_var_queue_beyond'(B, Vars).
121-
122113
term_attributed_variables(Term, Vars) :-
123114
'$term_attributed_variables'(Term, Vars).

src/lib/iso_ext.pl

+9
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
bb_put/2,
1010
call_cleanup/2,
1111
call_with_inference_limit/3,
12+
call_residue_vars/2,
1213
forall/2,
1314
partial_string/1,
1415
partial_string/3,
@@ -397,3 +398,11 @@
397398
Gs = []
398399
; true
399400
).
401+
402+
:- meta_predicate call_residue_vars(0, ?).
403+
404+
call_residue_vars(Goal, Vars) :-
405+
can_be(list, Vars),
406+
'$get_attr_var_queue_delim'(B),
407+
call(Goal),
408+
'$get_attr_var_queue_beyond'(B, Vars).

src/tests/dif.pl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/**/
22

3-
:- use_module(library(format)).
43
:- use_module(library(dcgs)).
4+
:- use_module(library(format)).
55
:- use_module(library(lists)).
66
:- use_module(library(debug)).
7-
:- use_module(library(atts)).
7+
:- use_module(library(iso_ext)).
88
:- use_module(library(dif)).
99

1010
% Tests from https://www.complang.tuwien.ac.at/ulrich/iso-prolog/dif

src/tests/when.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/**/
22

3+
:- use_module(library(iso_ext)).
34
:- use_module(library(format)).
45
:- use_module(library(dcgs)).
56
:- use_module(library(lists)).
67
:- use_module(library(debug)).
7-
:- use_module(library(atts)).
88

99
:- use_module(library(when)).
1010

src/toplevel.pl

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
:- module('$toplevel', []).
22

3-
:- use_module(library(atts), [call_residue_vars/2]).
43
:- use_module(library(charsio)).
54
:- use_module(library(error)).
65
:- use_module(library(files)).
@@ -28,7 +27,7 @@
2827
).
2928

3029
'$repl' :-
31-
asserta('$toplevel':started),
30+
asserta('$toplevel':started),
3231
raw_argv(Args0),
3332
( append(Args1, ["--"|_], Args0) ->
3433
Args = Args1
@@ -186,7 +185,7 @@
186185
bb_put('$report_all', false),
187186
bb_put('$report_n_more', 0),
188187
expand_goal(Term, user, Term0),
189-
atts:call_residue_vars(user:Term0, AttrVars),
188+
call_residue_vars(user:Term0, AttrVars),
190189
write_eqs_and_read_input(B, VarList, AttrVars),
191190
!.
192191
submit_query_and_print_results_(_, _) :-
@@ -451,4 +450,3 @@
451450
% is expected to be printed instead.
452451
; print_exception(E)
453452
).
454-

tests/scryer/cli/issues/handle_residual_goal.stdin

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use_module(library(dif)).
2-
use_module(library(atts)).
2+
use_module(library(iso_ext)).
33
-X\=X.
44
-X=X.
55
dif(-X,X).

0 commit comments

Comments
 (0)