From 2bf351a2f4a0e364d137f50fc67e3eadbdf22e7e Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Thu, 22 Jul 2021 22:29:04 +0000 Subject: Silence warning about singleton variables in system.pl and loader.pl --- loader.pl | 6 +++--- system.pl | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/loader.pl b/loader.pl index d688e46..a0af62c 100644 --- a/loader.pl +++ b/loader.pl @@ -94,7 +94,7 @@ handle_term(:- Directive, _, Module, NewModule) :- handle_term(Head :- Body, Singles, Module, Module) :- !, handle_clause(Head, Body, Singles, Module). -handle_term(Head --> Body, Singles, Module, Module) :- +handle_term(Head --> Body, _, Module, Module) :- !, write('DCG RULE: '), write(Head --> Body), @@ -132,7 +132,7 @@ handle_directive(ensure_loaded(F), Module, Module) :- ensure_load(F). handle_directive(set_prolog_flag(Flag, Value), Module, Module) :- Module:set_prolog_flag(Flag, Value). -handle_directive(module(NewModule, Exports), Module, NewModule) :- +handle_directive(module(NewModule, _Exports), _, NewModule) :- is_atom(NewModule), '$new_empty_module'(NewModule). % Do something about the exports as well. @@ -141,7 +141,7 @@ handle_directive(D, Module, Module) :- write(D), nl. -warn_singletons(_, Module, []). +warn_singletons(_, _, []). warn_singletons(PI, Module, Singles) :- write('Warning: singleton variables '), write(Singles), diff --git a/system.pl b/system.pl index cdfbaf3..5883aee 100644 --- a/system.pl +++ b/system.pl @@ -45,7 +45,7 @@ % Logic and control predicates \+ Goal :- call(Goal), !, fail. -\+ Goal. +\+ _. once(Goal) :- call(Goal), @@ -299,7 +299,7 @@ unique([H|T], [H|Rest]) :- findall(_, (member(X, T), X == H), []), !, unique(T, Rest). -unique([H|T], Rest) :- +unique([_|T], Rest) :- unique(T, Rest). union(A, B, C) :- @@ -315,7 +315,7 @@ unique_in([H|T], L, [H|Rest]) :- findall(_, (member(X, L), X == H), [_]), !, unique_in(T, L, Rest). -unique_in([H|T], L, Rest) :- +unique_in([_|T], L, Rest) :- unique_in(T, L, Rest). include(_, [], []). @@ -369,7 +369,7 @@ findall(Template, Goal, Instances) :- call(Goal), system:asserta('find all'(solution(Template))), fail. -findall(Template, Goal, Instances) :- +findall(_, _, Instances) :- findall_collect([], Instances). findall_collect(Acc, Instances) :- @@ -411,7 +411,7 @@ bagof_split([], [], []). bagof_split([WW+TT|RestWT], [WW|RestW], [TT|RestT]) :- bagof_split(RestWT, RestW, RestT). -bagof_unify_list(W, []). +bagof_unify_list(_, []). bagof_unify_list(W, [W|T]) :- bagof_unify_list(W, T). bagof_next_s([], _, []). @@ -523,7 +523,7 @@ atom_concat(A1, A2, A3) :- append(Codes1, Codes2, Codes), atom_codes(A1, Codes1), atom_codes(A2, Codes2). -atom_concat(A1, A2, A3) :- +atom_concat(_, _, _) :- instantiation_error. % Character input/output @@ -631,7 +631,7 @@ appropriate_flag_values(integer_rounding_function, [down, toward_zero]). appropriate_flag_values(char_conversion, [on, off]). appropriate_flag_values(debug, [on, off]). appropriate_flag_values(max_arity, [Val]) :- - current_prolog_flag(max_arity). + current_prolog_flag(max_arity, Val). appropriate_flag_values(unknown, [error, fail, warning]). appropriate_flag_values(double_quotes, [chars, codes, atom]). @@ -656,7 +656,7 @@ op(Priority, Op_specifier, Operator) :- is_list(Ops), op_helper(Priority, Op_specifier, Ops). -op_helper(Priority, Op_specifier, []). +op_helper(_, _, []). op_helper(Priority, Op_specifier, [Op|Ops]) :- is_nonvar(Op), is_atom(Op), -- cgit v1.2.3