Fork me on GitHub
Joshua Suskalo04:11:31

@sekao I've been told I should ask you about this. I'm trying to get lein-droid to work and it's having a ClassNotFoundException, not able to find the GenericVersionScheme class from org.sonatype.aether/aether-util. Is there a good alternative to building clojure for droid these days?


@suskeyhose You might check the #clojure-android channel as well. Not sure how active it is...

Joshua Suskalo04:11:20

Thanks. I'll check it out. It wasn't visible to me at first.


We have a lot of channels here. It can be hard to navigate sometimes!


Java interop question: I would like to take the results of a datomic query and construct a java object with them. Rather than doing (MyObj. (first result) (second result)) I would like to use apply to pass the arguments to the constructor of MyObj. However when I try to do that I get a compiler error. I'm guessing that just means that the . constructor is not actually a function. Is there a clean way to do this?


@captaingrover The only thing that comes to mind is to write a Clojure wrapper for your constructor: (defn my-obj [a b c d] (MyObj. a b c d)) or whatever you need and then you should be able to (apply my-obj result)


@seancorfield i think i'll do the inline version of that (apply #(MyObj. %1 %2 %3) results) which is definitely less awkward than what I had before. thanks!


what is the best way to handle a function in a pipeline that expects the piped value as the first arg when all the others expect it as the last arg. Is there a nice way to use an anonymous function to do that?


@captaingrover you can use as-> ( if functions expect the argument to be at different positions


@jumar thats awesome. thanks.


@captaingrover You can start with -> and have a nested ->> for the "last" position and then your first position expression (and then another nested ->> if you need it).


@seancorfield that seems like a good solution too. I like that with as-> I can call out a name to help my readers follow the transformations through the pipeline.


hi! is there a command in CIDER to "jump to a namespace"? (I type the namespace and it opens it in a buffer)


ah found it: cider-browse-ns-all


there's also cider-find-ns


@pwrflx also cider-find-var does the job. I place the cursor over a namespace (in the :require section), or simply over an interesting fn/var elsewhere this code avoids being redundantly prompted:

(defun jump-to-clojure-definition ()
  (let* ((old cider-prompt-for-symbol))
        (setq cider-prompt-for-symbol nil)
        (setq cider-prompt-for-symbol old)))


I’m trying to follow Carin Meier’s lein-jupyter walkthrough of the cats and dogs challenge. I’m stuck getting the jupyter notebook to launch without throwing an exception (I assume can’t find the clojure kernel, which is installed).... ?


@gonewest818 try the #data-science channel, Carin's active there.


is there a simpler way of writing (def color-regex #"^#[0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z][0-9a-z]") -- I need this to work in a cljc file, so it needs to work in both js and jvm


javascript allows for {n} so you could do #^[0-9a-z]{6}


and i imagine that jvm supports that as well


I misunderstood ... +1 to what dan said above ^


if you want something that looks a bit more explicit and you don't like regex syntax you could do something like (let [digits (repeat "[0-9a-z]")] (re-find (re-pattern (clojure.string/join (take 6 digits))) "aaaaaa"))


@U11BV7MTK: [0-9a-f]{6} is perfect


Re: clojure.jdbc - Does using with-db-transaction close the connection after it's finished? It's not immediately obvious from the API documentation


hi! in a clojure doc string, how to refer the reader to another function? similar to what can be done in javadoc as {<AT SIGN>link Whatever}


@pwrflx with backticks, normally clojure-mode will syntax-highlight it


@trevor You might try #sql.


@trevor Sorry, only just saw your question. Yes, with-db-transaction closes the connection as well as committing the transaction (or rolling it back if there's an exception).