简体   繁体   中英

How to remove nested clojure vector

I have

([[AA ww me bl qw 100] [AA ee rr aa aa 100] [AA qq rr aa aa 90]] [[CC ww me bl qw 100] [CC ee rr aa aa 67]])

and I need to remove the top nest so it becomes:

([AA ww me bl qw 100] [AA ee rr aa aa 100] [AA qq rr aa aa 90] [CC ww me bl qw 100] [CC ee rr aa aa 67])

Using flatten returns a list with just the inner elements which is not what I need. Thanks for helping..

You can use concat to remove a single level of nesting. Since you have a sequence of sequences you need to use apply :

(apply concat
  ([[AA ww me bl qw 100] [AA ee rr aa aa 100] [AA qq rr aa aa 90]] [[CC ww me bl qw 100] [CC ee rr aa aa 67]]))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM