Fork me on GitHub
#clojurescript
<
2022-03-11
>
Alex Miller (Clojure team)16:03:04

One more chance to complete the 2022 Clojure Survey!! https://www.surveymonkey.com/r/clojure2022

James Amberger23:03:05

Hi. I’m used to things like spread syntax from “other languages”, e.g. [a …b c] . What’s the right way to do that in cljs? i.e: [a b c] -> [a b1 b2 b3 c] ?

1
magnars07:03:37

Here's a fun one, altho I'm not sure it's recommended practice:

(let [a 1
      b [2 3 4]
      c 5]
  `[~a ~@b ~c])

rmschindler00:03:59

Have a look at flatten, as in:

> (flatten [1 [2 3 4] 5])
(1 2 3 4 5)

James Amberger23:03:24

I mean there’s flatten but not if eg c is also structured