Fork me on GitHub

@andrepnh I can't elaborate on it right now because I gotta go, but Go has a lot of flaws.


Broken type system with no generics, awful dependency management (which, for a newish language, is inexcusable given that Java's done it right for at least over a decade)...


@meowy: dependency management too? that one is new to me


most criticism I had or heard of golang can be summarized in this post:


@andrepnh Things might have changed, but last time I checked, Go's built in dependency management essentially only lets you get the master branch of a GitHub repo. No version management, nothing.


I do remember that some people came up with things like third party dependency managers that are meant to solve this issue, but...


My favourite part of Go is that I can write stuff in comments, that changes my code!


You guys might want to move this discussion over to #C03RZGPG3 since it’s no longer really about Clojure.


Hey everyone, I've got a question. How would I pair up two data structures? Example.. I have.. [["a" "b"], ["1", "2"]] And I want them to be.. [["a", "1"], ["b", "2"]]

Alex Miller (Clojure team)16:07:29

think of it as the firsts and the seconds - does that help?


Sorry, I probably should've elaborated a bit. Pairing up two of them is easy. The collections I have actually contain around 15 values each.


I've paired two of them, using the first and last options. But that won't be possible when there's more than 2.


Assuming all the collections have equal numbers of elements, you can map first them, then recur this operation to map rest of these collections, until the first collection is empty.

Alex Miller (Clojure team)16:07:48

you could use interleave

Alex Miller (Clojure team)16:07:13

interleave takes the first of each, the second of each, the third of each, ...


Yeah, nice one


@d-side: thanks, I've been trying to figure out a way that doesn't involve a loop though. @alexmiller good stuff


Well, there has to be a loop somewhere, if not in your code, then inside 🙂


I've been experimenting with interleave to figure out how to use that to my benefit. I suppose I was missing the partition function. Thx!


@d-side: yup. I just don't want to be the one to write it if/when there's something that does it for me 😃


Less code, less the chance to fail, I get it 🙂


user=> (map (fn[x i] [x i]) ["a" "b" "c"] ["1", "2" "3"])
(["a" "1"] ["b" "2"] ["c" "3”])


@byron-woodfork: taking advantage of the fact that map can also deal with multiple collections as parameters...


And if you want that to scale to arbitrary size, you could do (apply (partial map vector) colls)


@byron-woodfork: there is also partition-all which is the same as partition but it won’t chop off any remaining items that can’t be merged. see:


You all are awesome! Thx everyone 😃


@codonnell, I wonder what the scale/perf difference is (if any) between using (partial map vector) and mapv.


@akiva: I don't quite follow. Where are you suggesting using mapv?


Nevermind; I misread.


wonder if I could get some help here. I'm trying to do something really simple. I need to find matching ranges in an interval tree. I found this library

(require '[ :as it])
which looks like it may be able to do what I need but the documentation for it is... let's just say not the greatest. So here is the issue. Given this interval tree:
(def cts (into (it/interval-treeset :as-interval :span)
               [{:span [6 9] :id 4} {:span [6 8] :id 3} {:span [3 5] :id 2} {:span [0 2] :id 1}]))
all I want is to be able to get something like:
(it/gimme-thevalues cts 7)
=> {:span [6 9], :id 4} {:span [6 8], :id 3}
but for the life of me I can't figure out how to get that from this scant documentation:


the closest call I found that worked for just one the first interval was this:

(it/first-overlapping cts [7 7])
=> {:span [6 9], :id 4}


which is not quite what I want as I may have overlapping intervals and need all of them


still no answer that I can glean from there


I haven't tested it, but maybe use select-overlapping, then selection.overlapping-subset ?


not sure what the select-overlapping does 😕


is there a simple interval tree for clojure that isn't so hard to use?


I found another here: but it looks like abandonware and blows up even with the example on the front page