Fork me on GitHub

can I create a fakes3 local service using amazonica


I'm trying to push my first lib to clojars and am having problems with lein deploy clojars. When I get to the part where it wants me to enter my password for gpg, I paste it in (it's really long) and first of all, it displays it in plain text (not as asterisks) and when I hit enter, gpg doesn't seem to get the password. Does anyone know how to get around this?


if you are hitting the tty interface for gpg, things have already gone wrong


lein can't share stdio with another program outside the jvm, so to use gpg you need a graphical client, or ensure the key is currently unlocked in your cache


also, the gpg signature of the artifact is incomplete with clojars at best, and can be disabled or skipped safely


Oh, I'll just skip it then. Thanks for the advice @noisesmith!


Hey friends, can anyone shed some light about why the default implementation chosen for core.async buffers is Java LinkedList and not, for example, ArrayDeque?


how could I set the s3 to skip the MD5 check on the uploaded file, I am trying to upload an image to local fakes3, but I get SdkClientException Unable to verify integrity of data upload. Client calculated content hash (contentMD5: 9Uw72PrP2ixIz7jhExr9dg== in base 64) didn't match hash (etag: 85dbae523824f9d892cb09e0af48f124 in hex)


why would you want that? Seems like something is going wrong with your client?

👍 4

Does anyone know a library for controlling the mouse and keyboard? To simulate key presses and clicks?


Just wondering if any work or design has been done on the clj tooling for Windows?

Alex Miller (Clojure team)11:05:54

Yes, I’ve done a lot of work on it, just haven’t had the time to pull it over the line yet


Not a direct answer but relevant SO answer ? TIL, LinkedList is also implemented as a doubly linked list and hence accessing last element is O(1). Also it seems that ArrayDeque was introduced in Java 6 but I don't know if supporting Java 5 was an issue at the time core async was written. git blame doesn't show any rationale behind this.


Till Clojure 1.6 (March 2014) JDK 5 was the minimum JDK version supported : First commit to core.async was on May 2013. Just a wild guess Rich might have used it for JDK 5 compatibility. First core.async commit :

Alex Miller (Clojure team)11:05:30

It’s been long enough that I don’t recall why. It’s possible it was jdk 5 compatibility but I don’t remember that being a concern.


@alexmiller ArrayDeque should create a lot less GC pressure than a LinkedList , specially in high load...

Alex Miller (Clojure team)11:05:44

Feel free to submit a jira


Why is Comparator implemented in clojure.lang.AFunction and not in clojure.lang.AFn? I was looking at AFn and was quite confused (I didn't even know that AFunction existed).


Yeah, the message doesn't say much but thanks anyway!

Alex Miller (Clojure team)13:05:25

AFn is an abstract base class for function implementations and so is pretty generic

Alex Miller (Clojure team)13:05:24

AFunction is only used in one place and has a bunch more functionality, so it’s a much more narrow use case

Alex Miller (Clojure team)13:05:21

that one place being cached protocol functions


@alexmiller really ? all closures subclass AFunction, not only protocol functions

Alex Miller (Clojure team)13:05:09

point is still that AFn is a more generic base class


That thing I understand but I was surprised that Callable and Runnable are implemented in AFn while Comparator in AFunction

Alex Miller (Clojure team)13:05:19

Callable and Runnable are extensions of the IFn interface and thus implemented in the base to provide as much of the base implementation as possible. Acting as a Comparator is not something that is a general part of the IFn contract and so is not in IFn or implemented in the base.

👍 4

(defn unchunk
  (when (seq s)
     (cons (first s)
           (unchunk (next s))))))

(defn foo []
   (map #(do (println "i" %)
        (unchunk (range 1 51)))))

(first (foo)) ;; returns 1, prints i 1, i 2
Why do I see i 1, i 2 printed here?


Ah, I see. It’s because of the outer unchunk call in foo


Hmm, this prints four of them…

(defn unchunk
  (when (seq s)
     (cons (first s)
           (unchunk (next s))))))

(defn foo []
  (map #(do (println "i" %)
       (unchunk (range 1 51))))

(first (mapcat vector (foo)))


I really see that as a defect not an enhancement. Most not totally lazy seqs are due to chunking (32). That one is due to arg count (4)


temporarily I’ll fix it by using the suggested patches:

(defn join
   (when-let [s (seq s)] 
     (concat (first s) (join (rest s))))))

(defn mapcat*
  "Patched mapcat, see CLJ-1218"
  ([f] (comp (map f) cat))
  ([f & colls]
    (apply map f colls))))

(defn foo []
  (map #(do (println "i" %)
       (unchunk (range 1 51))))

(first (mapcat* (comp vector str) (foo))) ;; only prints 1, returns "1"

Alex Miller (Clojure team)14:05:28

why is this important to you?


I’m writing a crawler and I want to have fine grained control about how many links get crawled.

Alex Miller (Clojure team)14:05:13

if you need to precisely control when and how much of a lazy seq is realized, then you should not be using lazy seqs

Alex Miller (Clojure team)14:05:59

instead you should be using reduce/transduce/loop-recur etc


do transducers offer fine grained control over how many elements of the intermediate steps get realized?


I’ll try and see


(first (sequence
           (map #(do (println "i" %)
           (mapcat vector))
Prints 0 .. 32


@roklenarcic do you have some examples how to configure the client


I can use the more low level stuff, but if I do have fine grained control, I prefer the style of being able to use normal functions like take, first, etc.


eventually it all gets realized anyway, but for development I’d like to (take 2 ...) just for inspection and if it doesn’t realize too many, this is better

Alex Miller (Clojure team)15:05:09

expanding transducers get fully expanded on each step (mapcat is the prime example of this) - this is the difference in the transducer pull model vs seq push


I must be being stupid. I don't quite understand how you're recommending transducers be used here.

Alex Miller (Clojure team)15:05:23

if you want external control of iteration, then you need loop/recur.

Alex Miller (Clojure team)15:05:11

something that lets you take the next “thing” and choose when/whether to “do” it


looking for a lightweight lib to transform some HTML (specifically replace relative links/image src) — hickory, enlive come to mind, anything else I should check out?


I've had great luck with enlive for that sort of thing


Jsoup might be usable too for this kind of things


@martinklepsch I love Jsoup personally


Do you know of some places that have some Clojure code that would help me get started with this kind of thing?


I’m working on some Clojure code now that uses Jsoup


@martinklepsch Could send you some code if you want.


@alexmiller core.async might be a great fit for this too, yes. thanks for the suggestions.


got a question about ring/jetty - I need to read the HttpInputOverHTTP obj in the :body, and then reset it so it can be read again by another middleware


how would I go about creating a new HttpInputOverHTTP or something similar?


ah, it's just an inputstream with a fancy name (at least, that's how the other mysterious middleware in my app uses it)


well InputStream is abstract, so any particular one is going to be "fancy" in some way


I have a dependency problem i am trying fix for hours. core async seems to conflict with some other library and i get the following in the stack-trace: WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace:, being replaced by: #' lean? WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace:, being replaced by: #' Exception in thread "main" java.lang.ExceptionInInitializerError at clojure.main.<clinit>( Caused by: java.lang.IllegalStateException: Attempting to call unbound fn: #', compiling:(clojure/core/async.clj:469:6)


Can anybody suggest a workournd

Alex Miller (Clojure team)17:05:20

what versions are you using?


[org.clojure/core.async "0.4.474"]


but the problem persists in previous


of course clojure is 1.9

Alex Miller (Clojure team)17:05:08

what else are you using?


the rama library

Alex Miller (Clojure team)17:05:44

are you using lein or something else?

Alex Miller (Clojure team)17:05:00

lein deps :tree shows what?


many things


i tried most of the suggestions if not all in lein deps 🌴


one of the first things i did but non of them seemed to solve the issue

Alex Miller (Clojure team)17:05:37

well I can’t help you without more information


sorry for the delay


the terminal dump is huge

Alex Miller (Clojure team)17:05:50

my guess is that you are getting an incompatible version of tools.analyzer and that’s causing core.async to fail

Alex Miller (Clojure team)17:05:23

if you’re on latest lein, you can lein deps :why org.clojure/tools.analyzer


Ok ill try that

Alex Miller (Clojure team)17:05:53

which will give you the dep path to the tools.analyzer version being used in the deps tree


[org.clojure/tools.analyzer 0.6.9]

Denis G17:05:46

Does clojure participate in Google Summer of Code? Will it be possible to apply as a student for clojure at GSoC 2019?

Alex Miller (Clojure team)17:05:13

This depends on a) whether someone sends in an application for Clojure and b) and then whether they accept us. All of those possibilities have occurred in the past.

Alex Miller (Clojure team)17:05:07

At this point, I think Cognitect will probably not lead this but I have encouraged Clojurists Together to do a.

Denis G17:05:26

Sounds awesome. Thanks. The community/students come up with the proposals or do the developers behind the clojure do it?

Alex Miller (Clojure team)17:05:29

Anyone can propose projects but there needs to be a mentor willing to do it with the student


I'm currently a GSoC 2018 student working on a Clojure project, there were 2 or 3 projects this year looking for Clojure developers


Ok @alexmiller here is lein deps

Alex Miller (Clojure team)17:05:26

so you have tools.analyzer 0.6.9 at the top level and that’s what core.async includes as well

Alex Miller (Clojure team)17:05:07

another thing to watch out for is some sneaky snake including an older one of these libs inside their own jar (which is bad and wrong :)

Alex Miller (Clojure team)17:05:31

I think there is a lein plugin that you can use to find stuff like that


I just put tools analyzer there end excluded it from wherever i thought, including core.asyn and then forgot it there


The thing is a similar approach worked with a conflict in cheshire


i had before


Do you remember the name of the plugin ?


is it lein-pedantic ?