Fork me on GitHub

for projects with many namespaces that share a set of defrecords, is the convention to place the record definitions in their own namespace to avoid circular references amongst namespaces?


I think that generally signals poor organization, but let’s assume (I believe this is true) there are some valid situations where it’s a problem

Mario C.01:01:43

Is ring an interface between my web app and the network card?


I suppose for some definition of interface

Mario C.01:01:48

>abstracting the details of HTTP

Mario C.01:01:00

What does this mean?

Mario C.01:01:24

What would I need to do had I not used Ring?


it’s been a looong time since I’ve used ring, but I imagine they’re referring to is processing of requests and responses is abstracted as a pipeline of functions


ring is really a standard interface between http servers and clojure functions


so the alternative is to use the native interface of whatever http server


or to write your own http server


for example, there is ring-jetty-adapter, which takes jetty's interface and adapts it to ring, so it can response to an http request by invoking a clojure function


you could also use jetty's interface directly, or servlets (which is sort of a java standard interface to http servers)


there are something like a million layers between your code and your network card

Mario C.01:01:30

Is there a standard HTTP server?

Mario C.01:01:37

is clj-http


You can have a look at http-kit. It works as both client and server:


clj-http is an http client

Mario C.01:01:51

the http server my app uses if its in my project.clj


and is one of many


clj-http doesn't come with an http server

Mario C.01:01:48

So Jetty and Undertow are http severs? Not web servers?

Mario C.01:01:18

are these terms used interchangeably


in so much as the "web" is a concrete thing and not just a buzzword, it is a bunch of servers serving http to clients

Vincent Cantin03:01:57

Is there a library equivalent to Selmer which is also working in Clojurescript?


hey guys, i am trying to deref a variable from another namespace domain/@variable. Is this possible?




Because the symbol is domain/variable and @ is shorthand for (deref …)


thanks 🙂


is there a way to re-load the project level deps.edn without having to restart the REPL?

Alex Miller (Clojure team)15:01:12

that’s used to build the classpath that the JVM is started with

Alex Miller (Clojure team)15:01:24

and you can’t change the classpath dynamically

Alex Miller (Clojure team)15:01:53

(classloaders can be made to do this though and some tools like boot can do so via pods)

Alex Miller (Clojure team)16:01:32

for the more specific case of just adding a library, that’s something we have prototyped with deps.edn and I expect it will eventually be “in the box”

parrot 20

Luminus has generated code as follows for a new project, which doesn't compile:

(defstate ^:dynamic *db*
          :start (conman/connect! {:jdbc-url (env :database-url)})
          :stop (conman/disconnect! *db*))
What should this look like?


what's the specific error?


Syntax error compiling at (form-init14274565493373859375.clj:1:1).


oops that's huge

samcgardner23:01:17 if you'd like to see the offending code in context


the full stack trace is likely more useful than the code here - you can use *e in a repl to get the trace if it was hidden

👍 5

user=> *e
#error {
 :cause "Unable to resolve symbol: defstate in this context"
 [{:type clojure.lang.Compiler$CompilerException
   :message "Syntax error compiling at (/tmp/form-init14274565493373859375.clj:1:1)."
   :data #:clojure.error{:phase :compile-syntax-check, :line 1, :column 1, :source "/tmp/form-init14274565493373859375.clj"}
   :at [clojure.lang.Compiler analyze "" 6808]}
  {:type java.lang.RuntimeException
   :message "Unable to resolve symbol: defstate in this context"
   :at [clojure.lang.Util runtimeException "" 221]}]
Well, I guess that's pretty obvious. Thanks for the tip, didn't know about that!

🍻 5

it seems that this clj-file is lack of a require of "mount", which is required in the project.clj like [mount "0.1.15"]