nested list
- Subject: nested list
- From: Alessandro Campagni
- Date: Thu, 21 Mar 2013 08:03:28 +0100
Il giorno 20/mar/2013 17:17, "Jaime Villate" <villate at fe.up.pt> ha scritto:
>
> On 03/20/2013 01:45 PM, Stavros Macrakis wrote:
>>
>> xreduce('append, ...) will take [[a...],[b...]...] to [a...,b...,...].
>
> Ah, that's what we needed;
Of course it is! Thanks Stavros.
Again, thanks everybody for your time.
Alessandro
Il giorno 20/mar/2013 17:17, "Jaime Villate" <villate at fe.up.pt> ha scritto:
> On 03/20/2013 01:45 PM, Stavros Macrakis wrote:
>
> xreduce('append, ...) will take [[a...],[b...]...] to [a...,b...,...].
>
> Ah, that's what we needed; thanks, Stravos.
>
> (%i1) ts: [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]$
>
> (%i2) xreduce('append,makelist(makelist(append
> (x,[y]),y,last(x)+1,5),x,ts));
>
> (%o2) [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 3, 4], [1, 3, 5], [1, 4, 5],
> [2, 3, 4], [2, 3, 5], [2, 4, 5], [3, 4, 5]]
>
> Jaime
>
>