Fork me on GitHub
#off-topic
<
2018-11-24
>
emccue05:11:43

maybe thats a good start?

emccue05:11:50

:man-shrugging:

souenzzo13:11:13

There is some clojure (core/math/combo?!) function that do something like this?

(group-intervals 3 [2 3 4 6 7 12])
      => {2  [2 3 4]
          5  [6 7]
          8  []
          11 [12]}
I know that the keys I can generate with
(let [step 3 min-val 2 max-val 12]
  (take-while #(<= % max-val) (iterate #(+ % step) min-val)))

rakyi14:11:53

Maybe this is a https://en.wikipedia.org/wiki/XY_problem. What are you trying to solve? I don’t understand what is the function supposed to do from your example.

souenzzo19:11:16

done with loop/recur

souenzzo19:11:25

I'm doing histograms

dpsutton18:11:40

I don't know what's going on but range accepts start end and interval values

benoit23:11:28

@souenzzo Late to the game but group-by should work with a function that returns the right bucket for each number.

👍 1
souenzzo23:11:57

it's a group-by with a f that does (map f [2 3 4 6]) ;; => [2 2 2 5]