This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aleph (71)
- # aws (1)
- # bangalore-clj (4)
- # beginners (36)
- # boot (153)
- # cider (23)
- # clara (9)
- # cljs-dev (67)
- # cljsjs (2)
- # cljsrn (22)
- # clojure (348)
- # clojure-argentina (4)
- # clojure-austin (12)
- # clojure-berlin (9)
- # clojure-dusseldorf (6)
- # clojure-france (4)
- # clojure-italy (4)
- # clojure-russia (358)
- # clojure-spain (2)
- # clojure-spec (28)
- # clojure-uk (109)
- # clojurescript (130)
- # core-typed (1)
- # cursive (35)
- # datascript (6)
- # datomic (18)
- # emacs (12)
- # hoplon (4)
- # klipse (64)
- # lein-figwheel (13)
- # leiningen (3)
- # luminus (4)
- # lumo (51)
- # mount (22)
- # off-topic (83)
- # om (22)
- # om-next (8)
- # onyx (3)
- # pedestal (8)
- # perun (6)
- # portland-or (2)
- # re-frame (50)
- # ring (8)
- # ring-swagger (5)
- # untangled (10)
- # yada (9)
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:
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"]]
4. Restart cider
(ns example.core (:require [core.async :refer [chan <!! >!]]))
M-x cider-restart5. Compile, but get
CompilerException java.io.FileNotFoundException: 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 depsin 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.
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:
while the tests state the exact opposite? https://github.com/clojure/core.match/blob/master/src/test/clojure/clojure/core/match/test/regex.clj
(match ["AAA"] [#"AAA"] :a :else :b) =>:b
ok figured it out, - apparently I have to
:require clojure.core.match.regex... but why in the world must I do that explicitly?
so, if I import clojure.core.match.foo 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.
@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
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.
@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).
clojure.java.jdbc from the REPL, every time I do a query I get something like
(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.