Fork me on GitHub
#clojure
<
2015-08-15
>
whacked00:08:45

@hlship: main code is actually using a (->> (map (fn ...))) setup so I just tacked doall to the end of it simple_smile thanks!

tel00:08:37

What’s a good idiom for splitting or unzipping a list?

tel00:08:57

[[1 :a] [2 :b] [3 :c]] to [[1 2 3] [:a :b :c]]

tel00:08:04

also maybe called transposing an array

tel00:08:14

that’s not built in anywhere is it?

ghadi00:08:59

did the prior input come from a map?

tel00:08:03

actually, I’m wrong in what I want—I want the thing that does let binding parsing

tel00:08:20

[1 :a 2 :b 3 :c] to [1 2 3] and [:a :b :c] in one pass

tel01:08:41

I suppose I can just do the cons and reverse thing

ghadi01:08:12

there's take-nth as in [(take-nth 2 xs) (take-nth 2 (rest xs))]

tel01:08:27

will that work in one pass?

ghadi01:08:46

each call to take-nth in one pass

ghadi01:08:49

it's lazy

ghadi01:08:56

so two passes total

tel01:08:09

it’s probably nbd, I’ll go with that one simple_smile

ghadi01:08:43

a clever non-lazy way is (let [{numbers true kws false} (group-by number? xs)] ...)

ghadi01:08:55

leveraging map-destructuring and an aggregation

ghadi01:08:59

of course I could be missing something blindingly obvious. If the sources were a map, (keys map) and (vals map) have an order like (seq map)

tel01:08:19

I just went with take-nth

tel01:08:25

it’s unlikely these lists will be long

tel01:08:35

just feels weird to do a two-pass

tel01:08:52

also, core.match is beautiful for writing macros

tel01:08:12

Do undeclared Var warnings get skipped in macro output?

tel01:08:20

is there a way to get them back if so?

tel01:08:29

… it’s pretty sad to lose that