Clojure: Semi-Flattening a nested Sequence

后端 未结 5 723
走了就别回头了
走了就别回头了 2020-12-04 18:59

I have a list with embedded lists of vectors, which looks like:

(([1 2]) ([3 4] [5 6]) ([7 8]))

Which I know is not ideal to work with. I\'d lik

5条回答
  •  失恋的感觉
    2020-12-04 19:54

    If you only want to flatten it one level you can use concat

    (apply concat '(([1 2]) ([3 4] [5 6]) ([7 8])))
    => ([1 2] [3 4] [5 6] [7 8])
    

提交回复
热议问题