Re: Replace occurrence of a list with another?



Realised i needed a cut... it works now like so:

replaceall(Item,Repl,[H|T],[Repl|List]) :-
H = Item, !,
replaceall(Item,Repl,T,List).

But what would be a suitable stopping condition for it (after the 'H =
Item' is satisfied) and not go into the other replaceall predicate?

.