Rather than using FoldList, this seems to be a perfect application of recursion and memoization, which leads to a very elegant solution:
(* Your original list *) list[1] = {1, 2, 3}; list[2] = {7, 8, 9}; list[3] = {15, 20, 22}; (* The cumulative list *) cumulativeList[0] = {}; cumulativeList[n_] := cumulativeList[n] = cumulativeList[n - 1] ~Join~ list[n]
Now you just need to evaluate cumulativeList[3] and automatically, all the other values (i.e. 1, 2) are calculated.
cumulativeList[3] (* {1, 2, 3, 7, 8, 9, 15, 20, 22} *) Table[cumulativeList[n], {n, 3}] (* {{1, 2, 3}, {1, 2, 3, 7, 8, 9}, {1, 2, 3, 7, 8, 9, 15, 20, 22}} *)
FoldListwithJoinfor this? It will work! :) $\endgroup$Listis. It will cause collisions, as in this case. $\endgroup$AccumulatewithJoininstead ofSum. And you can useFoldList. So have a look at the documentation forAccumulate, it says:Accumulate[list]is effectively equivalent toRest[FoldList[Plus,0,list]]. So there you go! TryRest[FoldList[Join,{},list]]. $\endgroup$Listby doinglist[1]=...but merely assigning values to a symbol?[]associates values to symbols. In contrast,[[]]refers to list indices. In the title you wrote that you have a list of lists, and that would belist={{1,2,3}..}as mentioned in the comment above. Since the answers so far do not deal with list actually being aList, this is a question to think about first. $\endgroup$