<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%
% SICStus &amp; SWI's delete/3 takes the form delete(element,list,new-list)
% while ECLiPSe's takes the form delete(list,element,new-list)
%
% So we have to wrap them up to give a uniform interface.
%

:- module(delete_element,[delete_element/3]).

:- [prolog_detect].
:- prolog_detect:prolog(Prolog),
	(	(Prolog=sicstus,
		!,
		use_module(library(lists))
		);
		(Prolog=pfdm,
		!,
		use_module(library(lists))
		);
		true
		
	).



delete_element(List,X,New_list) :-
	prolog_detect:prolog(Prolog),
	delete_element(Prolog,List,X,New_list).

delete_element(sicstus,List,X,New_list) :-
	!,
	delete(List,X,New_list).

delete_element(swi,List,X,New_list) :-
	!,
	delete(List,X,New_list).

delete_element(eclipse,List,X,New_list) :-
	!,
	delete(X,List,New_list).

delete_element(_,_,_,_) :-
	write('*** delete_element/3 does not support this Prolog system'),
	nl,
	fail.

</pre></body></html>