This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-11
Channels
- # arachne (5)
- # beginners (28)
- # boot (59)
- # cider (10)
- # cljs-dev (10)
- # cljsrn (10)
- # clojure (58)
- # clojure-brasil (2)
- # clojure-czech (9)
- # clojure-miami (1)
- # clojure-poland (2)
- # clojure-russia (12)
- # clojure-spec (16)
- # clojure-sweden (1)
- # clojure-taiwan (1)
- # clojure-uk (77)
- # clojurebridge (3)
- # clojurescript (108)
- # cursive (5)
- # datomic (25)
- # defnpodcast (2)
- # editors (1)
- # events (1)
- # funcool (24)
- # hoplon (37)
- # instaparse (1)
- # lein-figwheel (7)
- # leiningen (7)
- # luminus (3)
- # off-topic (9)
- # om (90)
- # onyx (88)
- # proton (3)
- # protorepl (9)
- # re-frame (30)
- # reagent (23)
- # rethinkdb (2)
- # untangled (33)
- # vim (1)
- # yada (6)
(defn flatten-1 [coll]
(mapcat (fn [c]
(if (and (sequential? c)
(not (vector? c)))
c
[c]))
coll))
mapcat for exampleThanks @delaguardo
Hello Clojurians! I was wondering if there is something similar to http://locust.io/ in Clojure for benchmarking requests per second, does anyone know?
@richiardiandrea: i know of http://gatling.io/
@rohit thanks! I also saw http://grinder.sourceforge.net/index.html and there is even some Clojure scripting in there
…and there is a clj wrapper for it as well. https://github.com/mhjort/clj-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
@mhjort: I having a look and it does look very neat, especially the data-only part
There's also http://github.com/mhjort/clojider for distributed load testing
awesome
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
thanks will do
@gowder: go with msgpack http://msgpack.org/index.html 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?
https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md#checkout-dependencies
(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...)
@rhoslug: You can get quite far with just Java URL and http://clojure.java.io 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
Are you interest in how the compiler works or how it's invoked or something else?
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 do..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 http://flyingmachine.com which was useful.
Is what's "official"
clojure.main is generally just starting the repl or invoking a main so not necessarily invoking the compiler
There are a number of good talks on ClojureTV that go over some of compilation and evaluation
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.
then maybe this one https://www.youtube.com/watch?v=KhRQmT22SSg
which goes inside how the compiler works a bit more
conceptually at least
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?
(defn map-apply [f & args]
#_=> (let [argz (butlast args)
#_=> arg-splat (last args)]
#_=> (apply f `[[email protected] [email protected](apply concat arg-splat)])))
@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.
@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"})
"foo/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.
you can do this:
(apply bidi/path-for [[“foo/“ :id] :foo] :foo (mapcat identity {:id “3” :ok “ok”}))