Fork me on GitHub

How would I go about turning something like:


ie, unpack the seq in place. Thanks!


(defn flatten-1 [coll]
  (mapcat (fn [c]
            (if (and (sequential? c)
                     (not (vector? c)))
mapcat for example


Hello Clojurians! I was wondering if there is something similar to in Clojure for benchmarking requests per second, does anyone know?


@rohit thanks! I also saw and there is even some Clojure scripting in there


…and there is a clj wrapper for it as well.


haven’t used it. so can’t vouch for it


though i’ve heard good things about gatling


I've been developing clj-gatling for few years. It doesn't have all the features locust has but you can use clojure for writing tests


That was my reason for building the tool


@mhjort: I having a look and it does look very neat, especially the data-only part


There's also for distributed load testing


That's a tool that can run clj-gatling load tests using aws lambda infrastructure


yep, it looks like I found my tool of choice 😉


Cool. Btw, if you have any questions don't hesitate to ask. I am currently having a vacation but after that my goal is to further develop the tool a lot based on the feedback


@gowder: go with msgpack Works great and is simple to stream any size 'object' as well as arbitrary nested datastructures. Way better than base64 stuff.


If I'm using the checkout workflow to have projects depend on local projects, how can I propagate changes from the required project into the requiring project?


(right now, in my emacs cider, I have to restart cider in order to see changes... lein's a bit slow to make parallel development feasible if I have to restart every time...)


Is there a recommended library for querying an anonymous FTP with Clojure?


@rhoslug: You can get quite far with just Java URL and namespace.


(io/input-stream "") etc.


I wasn't hoping to do anything very complicated, just retrieve a file cool! thanks @juhoteperi


Is there a better online resource where I can learn about the build/compilation phase of clojure.? Almost all resources assumes Lein or Boot, which is a better way to get started, but what If I want to learn more about the internals?


The book Clojure Programming by Chas Emerick, et al. has quite a bit about the clojure reader. It’s a bit spread out throughout the book though

Alex Miller (Clojure team)22:07:35

Are you interest in how the compiler works or how it's invoked or something else?


@austb: thanks. Let me check that out.

Alex Miller (Clojure team)22:07:22

The tools mostly just align environments to call clojure.core/compile which invokes the compiler


@alexmiller: Yeah, about the compiler and even how its invoked.. Yeah that is what i have been trying to grok clojure.main and look at how compile is invoked... thought some one must have covered that already .. may be a blog post or something... I have found one from which was useful.

Alex Miller (Clojure team)22:07:33

clojure.main is generally just starting the repl or invoking a main so not necessarily invoking the compiler

Alex Miller (Clojure team)22:07:02

There are a number of good talks on ClojureTV that go over some of compilation and evaluation

Alex Miller (Clojure team)22:07:04

those are both useful ones I can think of


I was trying to invoke compile function from withing a repl invoked through clojure.main and was trying to understand what happens... Thanks for the video links... I think I have watched Life of a clojure expression... will check out the other one.

Alex Miller (Clojure team)22:07:06

which goes inside how the compiler works a bit more


thanks much.. have something to learn/watch tonight 🙂

Chris O’Donnell23:07:26

Is there a nice way to provide default implementations of a protocol's methods and then create an object which overrides a select few of them?


Suppose I have a function f that accepts keyword arguments. And suppose I have a clojure map argz. Is there something analagous to apply that I can use such that (map-apply f argz) will do the correct thing?


(For my actual use case, f is bidi/path-for)


(defn map-apply [f & args]
  #_=>   (let [argz (butlast args)
  #_=>         arg-splat (last args)]
  #_=>     (apply f `[~@argz ~@(apply concat arg-splat)])))

Alex Miller (Clojure team)23:07:57

@codonnell: nothing provided. it is possible to do as protocols are really maps under the hood and you can do things like this. However, the fact that you want to do it is maybe a smell that you’re over-using protocols.

Alex Miller (Clojure team)23:07:19

@danburton did you just try using apply?


user=> (apply bidi/path-for [["foo/" :id] :foo] :foo {:id "3" :ok "ok"})

clojure.lang.ExceptionInfo: Cannot form URI without a value given for :id parameter
user=> (map-apply bidi/path-for [["foo/" :id] :foo] :foo {:id "3" :ok "ok"})


The intended usage is (bidi/path-for [["foo/" :id] :foo] :foo :id "3").


Just using apply would, to my understanding, treat the map as a seq of pairs, rather than treating it as the keyword arguments to the function.

Alex Miller (Clojure team)23:07:56

(apply bidi/path-for [[“foo/“ :id] :foo] :foo (mapcat identity {:id “3” :ok “ok”}))