Fork me on GitHub

Adding dependencies to my project always is a bit of a hurdle. After some time fiddling they work, but I think I must be doing something wrong. Any pointers what that is would be very much appreciated. Here are the steps I've taken: 1. lein new app example 2. Add a dependency, e.g. core.async to the project.clj

:dependencies [[org.clojure/clojure "1.8.0"]
                           [org.clojure/core.async "0.2.395"]]
3. Add :require to ns
(ns example.core
  (:require [core.async :refer [chan <!! >!]]))
4. Restart cider M-x cider-restart 5. Compile, but get CompilerException Could not locate core/async__init.class or core/async.clj on classpath. 6. Kill repl, start a new one, compile - same result 7. Run lein deps in the project dir, restart repl, compile - same result


I can see /Users/vinai/.m2/repository/org/clojure/core.async/0.2.395/core.async-0.2.395.jar is in the classpath.


What am I doint wrong??


Got it, it was me being tired (of course), need to require clojure.core.async instead of core.async. That same thing happened to me before!


Why doesn't this work properly:

(match ["AAA"]
  [#"AAA"] :a
  :else :b)
while the tests state the exact opposite?


ok figured it out, - apparently I have to :require clojure.core.match.regex... but why in the world must I do that explicitly?


@vandr0iy because namespaces 🙃


Maybe it’s replacing the #” operator with a custom macro?


That’s a wild guess, I have no clue really.


so, if I import namespaces the matcher will magically gain additional capabilities? I don't like magic


@vandr0iy not exactly magic, if you check out the source, you can see that it registers some multimethods and extends some protocols as a side effect


I remember someone saying there was a way to add the docstring at the end of a function definition but I can't seem to find any documentation on how to do that.


@gdeer81 check out with-meta


Does anyone know why am getting this on IntelliJ IDEA sometimes No nREPL ack received


@manutter51 thanks, that's what I need I think. The discussion made it sound like you could add the string to the end but looking at defn you either need to use with meta or pass in the meta map at the end


It's just that I'm defining a function that is one line but it's using specs so it feels like it needs some documentation about that and it would be nice to have that at the end so it doesn't clutter the function definition

Alex Miller (Clojure team)19:02:50

@gdeer81 defn allows you to add a final trailing meta map

Alex Miller (Clojure team)19:02:35

only in the multi-arity case though iirc

Alex Miller (Clojure team)19:02:06

(defn foo ([] nil) {:doc “looky!”})

Alex Miller (Clojure team)19:02:58

personally, I think that’s unusual enough syntax that it would be clearer to put it at the beginning :)


@alexmiller awesome, that's what I was looking for. but yeah, now I'm thinking having (defn foo " mountain of .... multi-line ... documentation .. here ... " [] (do stuff)) isn't so bad


it makes sense to put it at the end if you have a lot of different arity definitions I guess


hi - i'm fairly new to clojure and I'm having trouble finding good ide / repl setup. I've tried VSCode and Atom/proto-repl but I'm not really happy with either of them. I'm used to F# / Visual Studio where you can just alt-enter to send code to the repl. Any suggestions on where else I should look would be appreciated. I did try IntelliJ / Cursive (twice) and cannot get the repl setup - as my lein repl options are greyed out.

Alex Miller (Clojure team)19:02:17

Cursive works great - maybe ask in #cursive if you need help with that?


@alexmiller thanks, I'll do that


@genec: did you just not like the ProtoREPL key bindings? You can evaluate code with just a keystroke (and run tests etc).


@seancorfield I do like ProtoREPL but I'm finding it a bit buggy. I'll try to execute a block (ctrl+, b) and i'll get an error msg, then I'll try it again and it will work. I'm starting the self hosted repl, not sure if that makes a difference. It's probably something I'm doing wrong with my ns setup.


@seancorfield continuing to test proto-repl and finding the nREPL is working better than the self hosted repl. my ns's are loading correctly now


@genec There’s a #protorepl channel where folks are very helpful. I recently switched to ProtoREPL full-time after years of Emacs / CIDER, and I’m finding it really solid (although slower than Emacs sometimes for some larger files).


Using from the REPL, every time I do a query I get something like (1) or (0) printing out. It's the only library I use regularly that does this, and I was wondering where I can go to read up about what it's using to do this and options to turn it on or off. I'm using the Cursive REPL if that makes a difference, I don't know if this is a REPL option or something specific to the jdbc library.


It doesn’t print anything @shaun-mahood — however some JDBC operations return results like that.


(jdbc/query …) simply returns the result set; other functions return a sequence of numbers of rows affected by the operation.


everytime I use JDBC I can’t stop myself from asking: why?


why they decided to return that particular value, that is


@seancorfield: Pretend this conversation never happened - rogue println in one function. 🙂