Re: Replace occurrence of a list with another?
- From: brianbasquille@xxxxxxxxx
- Date: 28 Apr 2006 16:24:23 -0700
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?
.
- References:
- Replace occurrence of a list with another?
- From: brianbasquille
- Re: Replace occurrence of a list with another?
- From: Bill Spight
- Re: Replace occurrence of a list with another?
- From: brianbasquille
- Re: Replace occurrence of a list with another?
- From: Bill Spight
- Replace occurrence of a list with another?
- Prev by Date: Re: BUG REPORT : SWI-prolog
- Next by Date: Why Not Prolog in Prolog ?
- Previous by thread: Re: Replace occurrence of a list with another?
- Next by thread: Create a List of Lists
- Index(es):