Re: Iterative union
- From: Thorsten Kiefer <toki782@xxxxxxxxxxxxxxxx>
- Date: Wed, 21 Feb 2007 11:29:49 +0100
phantastic@xxxxxxxxxx wrote:
Hi,
I have a list like this: [[[a,b],[b,c]],[[c,d],[d,v]]] where the
number of elements (sublists) is two but number of elements inside
sublist can be random.
I want a list like this: [[a,b,c], [c,d,v]] (in this case)
I have considered union/3 predicate but I don't know how I can iterate
on every member of the list.
Any help?
thanks
Maybe like that :
map(_,[],[]).
map(F,[X|XS],[Y|YS]) :- apply(F,[X,Y]),map(F,XS,YS).
Regards
Thorsten
.
- Follow-Ups:
- Re: Iterative union
- From: phantastic
- Re: Iterative union
- References:
- Iterative union
- From: phantastic
- Iterative union
- Prev by Date: Iterative union
- Next by Date: Re: Iterative union
- Previous by thread: Iterative union
- Next by thread: Re: Iterative union
- Index(es):
Relevant Pages
|
|