Fork me on GitHub
Mitul Shah14:08:22

hi all, i’m using cursive with intellij but all my symbols are considered unresolved. which means pretty much every line has the siggly indicating an error (though there isn’t) does anyone know how to fix this?


Hi, how to use :refer :all? Does that mean the functions can be directly used?


Yeah, if you refer all the functions from some namespace you no longer have to use their fully qualified symbols within the current namespace.


If I do (:requre [] :refer :all) then, I can refer any function from any of the namespaces - ( or


The :refer :all part goes within the vector and applies only to the symbols in that particular namespace.


I don't think you can do a wildcard-like match against multiple namespaces. Remember that the part after the last period should match to a filename while all the parts before periods should map to folder names, so the entire libspec directly maps the namespace symbol to a file in the tree.


Namespaces do not represent a hierarchy so there's no sense that is "inside" -- they have no relationship to each other.


(:require [ :refer :all]) is essentially the same as (:use -- which is not recommended (because then you can't tell which namespace a symbol comes from). You really should use an alias like (:require [ :as one]) and then one/stuff to refer to names within that namespace.


It's OK to :refer specific symbols if it makes the code more readable -- and in tests sometimes folks will relax that "rule" and just refer in all of clojure.test (but I still think it's better practice to just :refer [deftest is] and be explicit about what symbols you are using).


can anyone recommend a good book/tutorial for building a web server with some simple database logic, that doesn't use luminus? I still feel uncomfortable using it because I'm so completely lost when I have to debug errors. Creating a server with ring is easy enough (for me, at least), but I'm looking for a bit of guidance on best practices, especially testing, as well as using component or a similar library

practicalli-johnny07:08:35 is a simple project that covers building a web server is a big more involved and includes database access too, using next.jdbc


@varun.jayaraman if you are comfortable with the ring part, component docs have a sample database component, the final connecting bit is that you put the system map into the request map so the handler can use it


@varun.jayaraman I would usually do this by putting a middleware function into the system map then extracting that into the request handler


alright thanks, i'll take a look


might fit the bill