shithub: pprolog

Download patch

ref: 2bf351a2f4a0e364d137f50fc67e3eadbdf22e7e
parent: 9cc17961834515fd9e09683738a0137964076dd7
author: Peter Mikkelsen <peter@pmikkelsen.com>
date: Thu Jul 22 18:29:04 EDT 2021

Silence warning about singleton variables in system.pl and loader.pl

--- a/loader.pl
+++ b/loader.pl
@@ -94,7 +94,7 @@
 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 @@
 	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 @@
 	write(D),
 	nl.
 
-warn_singletons(_, Module, []).
+warn_singletons(_, _, []).
 warn_singletons(PI, Module, Singles) :-
 	write('Warning: singleton variables '),
 	write(Singles),
--- 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 @@
 	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 @@
 	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 @@
 	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([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 @@
 	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(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 @@
 	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),