Fork me on GitHub

I am setup s3-wagon-private to deploy some private packages in my company


how can I have access to these repo in other packages?


thnaks @alexmiller I'll read it asap

Brandon Olivier02:05:53

Is anybody familiar with compojure-api?

Brandon Olivier02:05:22

I'm trying to run it, but it's crashing immediately with Call to clojure.core/fn did not conform to spec. I haven't changed a line of code yet.


@bolivier Sounds like you have an outdated version of some library in your stack.


compojure-api is widely used and works well. Can you share your project.clj if you're using Leiningen?

Tom Le03:05:28

How to import relative path file in clojure

(defn read-file [fname]
  (io/resource fname)
  (with-open [rdr (io/reader fname)]
    (into [] (line-seq rdr))))

Tom Le03:05:54

Seem it’s depend where i run repl

Brandon Olivier03:05:00

(defproject invyte "0.1.0-SNAPSHOT"
   :description "FIXME: write description"
   :dependencies [[org.clojure/clojure "1.8.0"]
                  [metosin/compojure-api "1.1.11"]]
   :ring {:handler invyte.handler/app}
   :uberjar-name "server.jar"
   :profiles {:dev {:dependencies [[javax.servlet/javax.servlet-api "3.1.0"]
                                  [cheshire "5.5.0"]
                                  [ring/ring-mock "0.3.0"]]
                   :plugins [[lein-ring "0.12.0"]]}})

Alex Miller (Clojure team)03:05:49

there should be more to the message that points to a place in the code?

Brandon Olivier03:05:30

unfortunately, I'm not sure what to make of it

Alex Miller (Clojure team)03:05:54

so that's in org.clojure/core.unify lib

Alex Miller (Clojure team)03:05:36

not sure what's pulling that in - there are probably 60+ transitive deps from that project

Alex Miller (Clojure team)03:05:19

lein deps :why org.clojure/core.unify will tell you the dep path

Alex Miller (Clojure team)03:05:49

unify spec errors were fixed in 0.5.7

Brandon Olivier03:05:00

that command is blank

Brandon Olivier03:05:08

well, returns nothing

Alex Miller (Clojure team)03:05:23

might be coming in through a plugin or some other global profile

Alex Miller (Clojure team)03:05:15

adding [org.clojure/core.unify "0.5.7"] could potentially workaround it, depends how much you're interested in figuring out the real why vs moving forward right now

Alex Miller (Clojure team)03:05:51

lein deps :plugin-tree shows plugin tree deps

Brandon Olivier03:05:40

the real why is, I'm sure, interesting, but I'm pretty new and would probably be better off just moving forward


I wish the beginner docs didn't tell people to use lein-ring but instead taught people how to start Jetty directly in their app, so they could just lein run instead...


I don't see core.unify coming in from any of those deps @bolivier -- what do you have in ~/.lein/profiles.clj? I suspect that's more likely to be your problem.


(there are certainly plenty of version conflicts in the deps you have in project.clj which is a problem in itself -- but it's not causing that error)

Alex Miller (Clojure team)03:05:44

(as an aside, you will also probably find the error experience better with lein ring / lein run when using Clojure 1.10.1-RC1, to be actually released in the next week or two)


@bolivier I updated your project.clj to use Clojure 1.10.1 and couldn't repro that error message -- so I'm fairly sure it's in your ~/.lein/profiles.clj instead.

Brandon Olivier04:05:00

@seancorfield I don't have a ~/.lein/profiles.clj, and when I updated to 1.10.1, I get what looks like the same error still


That's weird. I can't repro that here. I don't even see core.unify pulled in from those dependencies...


You're on Mac/Linux, right @bolivier?


If you run lein deps :tree |wc what does that produce?


(I'm expecting 71)

Brandon Olivier05:05:30

I get a lot of output, oddly enough

Brandon Olivier05:05:41

but it ends in 71 164 2978

Brandon Olivier05:05:49

so I think that's probably expected


Well, yeah, there's all the dependency conflicts...


Something in your deps is pulling in leinjacker and that's where the problem is -- it's pulling in an old version of core.unify.


If you add [org.clojure/core.unify "0.5.7"] to your project.clj I think you might get past this.


(but, frankly, at this point I think I'd recommend looking at clj/`deps.edn` instead of Leiningen so that you're working with something simpler)


Are you absolutely sure you don't have a profiles.clj file @bolivier?


I just checked and leinjacker is not involved in any of those dependencies -- you must have a profiles.clj file pulling in additional dependencies @bolivier

Brandon Olivier05:05:42

Could it be in a different place?


What's in ~/.lein?

Brandon Olivier05:05:01

I have a ~/.lein dir, but it's empty


Really? That's just weird.

Brandon Olivier05:05:43

Is there a way I can quickly purge all the deps and re fetch them?


What does lein deps | fgrep leinjacker show?


or lein deps 2&>1 | fgrep leinjacker

Brandon Olivier05:05:30

Couldn't find project.clj, which is needed for deps


You must have project.clj for this.


You can't be doing any of this without a project.clj file...

Brandon Olivier05:05:18

could it have been deleted?


It's in your project directory.


You can't run lein without that file.

Brandon Olivier05:05:11

oh, I didn't realize you meant for me to run int in the projects dir

Brandon Olivier05:05:19

the project dir has a project.clj

Brandon Olivier05:05:22

and that command has no output


Well, of course. That's the project you're having problems with...

Brandon Olivier05:05:44

just a silly mix up


At this point, I have absolutely no idea. The errors you're reporting can't happen based on what you've told us.

Brandon Olivier05:05:24

Well, thanks for trying to help me out


None of the dependencies from your project.clj can produce that error.


The only way those errors can be produced is from a .lein/profiles.clj file in your home directory.


Are you on Windows?

Brandon Olivier05:05:26

I'm running Linux


Hmm... then I have no idea. Sorry. Your errors make no sense at all 😞


I would suggest creating a very basic new project and seeing if you can get it running, and then adding dependencies one at a time until it fails.

Brandon Olivier05:05:54

I deleted ~/.m2, figuring some of the java libs might be stored there, and it's definitely fetching leinjacker again


I have no idea why -- nothing in your dependencies needs leinjacker


Are your sure you don't have a .lein folder in your home directory?

Brandon Olivier05:05:32

I do have one, but it's empty


At this point, I hate to say it, but I just don't believe you.


The error you're reporting cannot be produced from the project file you provided.

Brandon Olivier05:05:21

I understand that, but I don't see anything in that directory

Brandon Olivier05:05:50

What would be the fix assuming there was a ~/.lein/profiles.clj?

Brandon Olivier05:05:58

if you can speculate


The fix would be removing the dependencies that are bringing in the problematic libraries.


I created a project like this

seanc@DESKTOP-QU2UJ1N:~/clojure/brandon$ cat project.clj
(defproject invyte "0.1.0-SNAPSHOT"
   :description "FIXME: write description"
   :dependencies [[org.clojure/clojure "1.10.1-beta1"]
                  [metosin/compojure-api "1.1.11"]]
   :ring {:handler invyte.handler/app}
   :uberjar-name "server.jar"
   :profiles {:dev {:dependencies [[javax.servlet/javax.servlet-api "3.1.0"]
                                  [cheshire "5.5.0"]
                                  [ring/ring-mock "0.3.0"]]
                   :plugins [[lein-ring "0.12.0"]]}})
and that runs a REPL just fine.


If I run lein ring server I get this error

Retrieving ring/ring-jetty-adapter/1.6.1/ring-jetty-adapter-1.6.1.jar from clojars
2019-05-22 22:25:16.562:INFO::main: Logging initialized @2584ms
Syntax error (FileNotFoundException) compiling at (/tmp/form-init4402686125591950306.clj:1:73).
Could not locate invyte/handler__init.class, invyte/handler.clj or invyte/handler.cljc on classpath.
Full report at: /tmp/clojure-6013848232846396032.edn
Subprocess failed


(this is why I will not use plugins)

Brandon Olivier05:05:35

I can run the repl (in a new project with that project.clj) but I cannot run ring server


Right, I can run a REPL but I cannot run lein ring server (and I wouldn't recommend doing that anyway)

Brandon Olivier05:05:58

I tried it out on my mac, and I had the same problem

Brandon Olivier05:05:07

but I do have a ~/.lein/profiles.clj there

Brandon Olivier05:05:50

{:user {:plugins [[cider/cider-nrepl “0.16.0”]]
         :dependencies [[org.clojure/tools.nrepl “0.2.7"]]}}

Brandon Olivier05:05:55

That's what's in it


I've no idea at this point. Works on my machine.


My recommendation: don't use plugins at all; learn to use clj and deps.edn.


Leiningen has far too much magic, IMO.


For example, tools.nrepl is at 0.2.13 and cider/cider-nrepl is at 0.21.0 so you should at least update those and try again @bolivier


(and you probably shouldn't have cider in there at all -- CIDER tries to inject the right version when it starts up anyway)


Hi, I'm a front end developer and recently fallen in love with clojure, Is there any suggestion and recommendation for someone who just want to start.


Clojure for the Brave and True is probably the default recommendation, as something you can follow online


Clojure for the Brave and True is awesome but it is an entire book on Clojure though, and not without its own roadblocks. If you are just trying to get your feet wet it may be too much and end up scaring you. Don't let that happen! Try it, but if you meet a blockade, there are other resources, both paid and free, so just ask us again, maybe giving more details of what you are trying to achieve. Welcome! 🙂


Thanks, I'm trying to up and running with clojure. I don't know which editor and which tools are popular in the community. I'm using vscode these day happily for front end web development


I believe most people use Emacs, IntelliJ with Cursive or Atom at this point in time. There are people using all the other editors as well. Just one tip: don't try to learn an editor while learning the language, or even to "fine tune" your editor too much. Get syntax highlighting working and use a terminal REPL until the limitations of this setup show up. Learning/working on both things at the same time can make it a rough and unpleasant experience. If you are fine with VSCode, stick with it until you get the basics of the language and the love in your heart grows stronger, and then you you will be better equipped to deviate from the learning path and work on your tools. 🙂

felipebarros06:05:19 is an Emacs starter kit where you can enable a Clojure "layer" that is very solid.

felipebarros06:05:59 is another Emacs starter kit with a very solid Clojure config.


Many thank, That's great advice thanks2


and also which resources do u recommend for learning clojure, as you said clojure for the Brave and True maybe not a good choice


Well, those other two books are also regarded as great introductions. The one thing that worked for me was though 🙂 It's paid but he offers regional pricing to make it affordable. If you prefer videos, http://PF.TV is excellent. If you prefer books, those 3 will keep you pretty busy.


Since you come from JS land like I did, here are some interesting articles that I happen to have at hand.


Many thanks, I'v learned so much


I generally recommend either quick clojure or mastering clojure if you don't mind buying the books.

replied to a thread:@seancorfield thanks:+1:

Many thank, That's great advice thanks2


@tensordeveloper thanks I I'm gonna get quick clojure


hello, i want to use the to build my nav, and i write the test code


this is the error msg


i read the readme, and see that the title can be object, it’s that i can define my own component and show it in the title?


is it possible to make the http-kit client return a channel with the result for async calls instead of a promise? I looked through the docs and I couldn't find anything.


Hi , I want to integrate google and FB sign in in my project .... please suggest me some decent libraries for that

Kari Marttila13:05:04

Do you remember when I ordered the Purely Functional yearly subscription using my corporation hideous purchasing system? I managed to do it and they approved the order! Yihaa! This is the first course I'm going to watch this evening after my corporate hours: I'll tell you my first impressions when I have watched the training video.

Kari Marttila13:05:27

I just chatted to my line manager today: "Where is my next cool cloud project in which I can create cool infra using Terraform and do some big data processing using Clojure and Spark?"

Kari Marttila13:05:49

I'm really burning to use my new Clojure skills to do some great system in some of the mainstream clouds using Terraform and using Clojure to implement the application logic.

Kari Marttila13:05:51

BTW. Since the corporation order process wasn't a never ending story after all, I'm considering to order a couple of other good training sites for my corporate life and for Clojure development in the cloud (AWS, Azure, GCP). Any suggestions? For training my next cloud certification (GCP) I considered which is highly recommended by some of my corporate colleagues. Any comments?

Kari Marttila13:05:45

My line manager told me to do a GCP certification - I thought that as part of my studies I could try to build a simple Dataproc system (GCP Hadoop managed service), use some Google published example big data and do some processing using Clojure Spark library, e.g. Flambo (

Kari Marttila13:05:07

... I guess you got my point - another excuse to use Clojure 🙂

Kari Marttila13:05:01

BTW. Are there experiences how different Spark is regarding which library you use (Java, Scala, Python or Clojure)?


in my experience Scala is the best API to use – it has the most external libraries, its inclination toward immutability meshes well with Spark's execution model, and will overall have a much nicer development experience for those accustomed to a functional style.


I've never tried using Clojure for Spark, mostly because it's not supported by Databricks and I can't justify the DevOps overhead for a toy project that uses Clojure to call the Spark API, so I can't really compare it to Scala.


I have what could be a very stupid question … but I just wrote what I think is “Hello World” in Clojure but there are an insane amount of directories & documents in my “project.” — I have always heard that Clojure cuts down on the amount of code and makes things simpler — therefore I am worried I did something wrong?


^ Does that look normal?


it looks like you used luminus or similar?

Kari Marttila13:05:08

I recommend to delete that project and e.g. download this one:


I have not idea what that is … but maybe


a leiningen template

Kari Marttila13:05:42

You don't need leiningen, luminus etc for learning basic stuff.


here's my basic project layout


I just used the Intellij starter template


I think that's your problem - IDEs can be very opinionated about project layout, especially when coming from the Java world where this absurd duplication of namespaces is considered "best practice."


you've ended up with a batteries included bells and whistles template, like checking all the boxes in Visual Studio for an http://ASP.NET project

Kari Marttila13:05:04

Clone the demo-deps project and start adding your own functions there...


Okay. Thanks guys. I will keep at this.

Alex Miller (Clojure team)13:05:47

I wouldn't even bother cloning that project

Alex Miller (Clojure team)13:05:56

you could just start with a src/hello.clj, and a deps.edn file that is just {} and that's enough

Kari Marttila13:05:49

Heh, there you have it - even simpler way to start. 🙂


Can anyone please recommend any up to date Youtube / Udemy / Coursera / Lynda / or Pluralsight videos? —


Are you interested in learning Clojure the language or rather how to setup and work efficiently with Clojure tooling/editors?


Anyway, I think the best collection of videos, especially for beginners, is


Tim Baldridge's videos are great too:


There's some useful stuff on too but sadly author seems to be busy with other things rather than adding more stuff consistently


and although I haven't watched this one it could be useful too: Clojure videos by Brian Will:;list=PLAC43CFB134E85266


I am coming from Python so I am very familiar w/ Pycharm & Intellij and would love to stick w/ those editors.

Alex Miller (Clojure team)13:05:24

amac:tmp alex$ mkdir hello
amac:tmp alex$ cd hello
amac:hello alex$ echo "{}" > deps.edn
amac:hello alex$ mkdir src
amac:hello alex$ echo "(ns hello)" > src/hello.clj
amac:hello alex$ clj
Clojure 1.10.0
user=> (require 'hello)

👍 4
🙌 4
Kari Marttila13:05:30

I'm using Cursive with IntelliJ IDEA and I'm very happy with them.

Alex Miller (Clojure team)13:05:50

you can import that project in Cursive as a deps.edn project and go from there

Kari Marttila13:05:14

See: => Very good instructions how to use Cursive.


Thanks for that — it looks very helpful.

Kari Marttila13:05:47

If you have some issues with how to configure Cursive with deps.edn or something like that - chat here - we help you.

Alex Miller (Clojure team)13:05:03

(or cursive specific questions in #cursive)

Kari Marttila13:05:25

Yep, sorry for forgetting that. #cursive is the place for those questions.


this slack is totally the place to go to get help, lots of friendly faces about

Kari Marttila13:05:50

cfleming - the creator of Cursive - is very helpful there.

Kari Marttila13:05:45

And if you buy a commercial Cursive license and have any issues related to Cursive - he responds very quickly to your emails and provides excellent support. I have used the support only once and it was amazingly fast and solved my issue right away. Used support only once since Cursive is very stable and intuitive.

Kari Marttila14:05:28

Many corporate employees have subscriptions in Pluralsight ( There are just a couple of Clojure courses (pretty old). A hint for Clojure gurus - why not create some learning material in Pluralsight (and possibly make some money).

Alex Miller (Clojure team)14:05:02

the (old) courses are probably still relevant btw


I'm struggling to create a test that effectively tests atom watch functions. I have to create a new atom each time and use swap! in order to fire the function. Is there a better way?


@david.folkner Seems reasonable. Though remember your watch function is just a normal function, so you can test it independently of actually attaching (add-watch ...) it to a atom.


Ahh...good point! It has a swap! in it though, so it gets a little messy.


If you are swap!'ing on the ref that add-watch calls your watcher function with, then that can get kind of complicated. I would consider if there is a way to do what you need without that pattern?


There is probably a different way to do it. I did run into an infinite loop at first. I'm making a simple go-fish game. Watch looks for 0 cards in the deck or a players hand, then determines the game is over.


(defn game-over-watch
  "Watches game state to determine when game is over.
  Looks for empty deck or player hand.  If game is not complete
  it will swap the state to change it to complete."
  [_ watched _ new-state]
  (when (and (or (zero? (-> new-state :deck count))
                 (some #(zero? (-> % :hand count)) (:players new-state)))
             (not= "complete" (:status new-state)))
    (swap! watched assoc-in [:status] "complete")))


I'm very open to any other ideas.


(defn mark-when-game-is-over
  "Marks the state as complete when the game is over"
  (when (and (or (zero? (-> state :deck count))
                 (some #(zero? (-> % :hand count)) (:players state))))
    (assoc-in state [:status] "complete")))

(comp mark-when-game-is-over whatever-function-you-are-currently-passing-to-swap!)


Trying to stay within the rails of your idea, but maybe just compose your mark-when-game-is-over to the function you pass to swap!


Hmmm...that could work. I have lots of other functions, so I'd have to call that a lot. I could macro it up though. That could be good practice.


Sure, I mean, it is a bit crazy, but you could also make your own swap! with something like (defn completionist-swap! [atm fx & args] (apply swap! atm (comp mark-when-game-is-over fx) args))


in turn based games there's often a place to check for winning after each turn


Yeah. The game could end mid-turn. I was thinking of using the state to drive everything. So it changes and drives all behavior, but this is just a simple learning app.


Absolutely. Explore! Have fun.


Also, macros are hard. 🙂

Dave Compton15:05:39

I'm trying to "require" reagent.core in a bare bones clojurescript program but getting a compile error: Caused by: clojure.lang.ExceptionInfo: No such namespace: reagent.core, could not locate reagent/core.cljs, reagent/core.cljc, or JavaScript source providing "reagent.core" in file /repos/gitnc/clojurescript_test2/src/demo/static_website.cljs {:tag :cljs/analysis-error} . What do I need to do to make "reagent.core" locatable?


@davecompton7 have you added the reagent library to your projects dependencies, and restarted the ClojureScript build process?

Dave Compton16:05:30

no. How do I add the reagent library to my project's dependencies?


which tool are you using to run your build? lein?


in your deps.edn, add to your :deps map reagent {:mvn/version "0.8.1"}


I found this on their clojars page: which was linked to on their github:

Dave Compton16:05:25

Thanks! That did it.


Does anyone know if I can provide a seed to generate values using spec? For example I can run: (-> int? s/gen g/generate), which generates a random integer. But I’d like to generate an integer based on a seed (so I can reproduce it)


clojure.spec.test.alpha uses test.check under the hood, which accepts a :seed keyword arg to check and quick-check


it also returns a seed that was used when a failed case is generated


Ah but that seed is used to re-run a failing test then


But not to actually generate values for other purposes, at least that’s what it looks like to me


it tells you what seed it was using when it failed, so you can use that seed to reproduce the failure


nothing stops you from inventing arbitrary seeds and feeding them to the test


but it's already randomizing its starting state, so I don't know when you'd need that


Ahh [org.clojure/test.check "0.10.0-alpha4"] seems to have a generate function that accepts a seed, 0.9.0 didn’t accept one


Thanks for the help!


I'm getting going with web development with clojure and luminus. I have things running in dev locally in my repl. How do I inspect the requests as they come through? I currently put println statements in the functions I care about.


@david.folkner println debugging is a perfectly reasonable approach. Are you looking for a way to print all requests? You could write simple middleware for that (there may even be such a thing in a library out there somewhere).


(defn print-mw [handler]
  (fn [req]
    (println "request:" req)
    (let [resp (handler req)]
      (println "response:" resp)
That's a middleware function that would print all requests and responses.


Gotcha. that's perfect. Thanks. All, would be a bit much, just wanted to inspect data and states...`pprint` it is!

Alex Miller (Clojure team)20:05:27

if you want less, just filter those maps with select-keys, etc

Dave Compton23:05:00

I'm trying to use the "-w" option to get a recompile to happen every time my source file changes but it does not seem to be working.


the -w option to what?

Dave Compton23:05:05

sorry.... the -w option to cljs.main

Dave Compton23:05:20

here's the command line that I've tried: rm -rf demo-clojurescript-gh-pages/; clj -m cljs.main -d "demo-clojurescript-gh-pages/out" -c demo.static-website -w demo

Dave Compton23:05:18

the source file is src/demo/static_website.cljs

Dave Compton23:05:07

I've tried other options for the path: "demo", "src/demo", "src"

Dave Compton23:05:07

but in every case the command builds successfully once and then exits.


what makes you think cljs.main takes a '-w' argument?

Dave Compton23:05:36

from cljs.main --help output : -w, --watch paths Continuously build, only effective with the --compile main option. Specifies a system- dependent path-separated list of directories to watch.

Dave Compton23:05:21

that's contained in the output from : clj -m cljs.main --help

Dave Compton23:05:22

am I misinterpreting that?


I think you have to specify -w before -c

Dave Compton23:05:06

I think that's working.