Fork me on GitHub
#cider
<
2024-02-06
>
skyjuice18:02:42

Clojure newb sent here from #C053AK3F9, When I cider-eval-buffer on the following code, the "/welcome" response map causes the ensuing error: core.clj

(defn app [req]
  "/"
  {:status 200 :body "Till forever" :headers {}}

  "/welcome"
  {:status 200 :body "<h1>Welcome</hl>
                        <ul>
                           <li><a href="/greeting">Greeting</a></li>
                        </ul>"
   :headers  {"Content-Type" "text/html; charset=UTF-8"}})
Error:
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See  for further details.
Syntax error reading source at (core.clj:16:50).
Invalid token: /greeting 
Emacs 29
$ clojure -version
Clojure CLI version 1.11.1.1435

$ java -version
openjdk version "17.0.10" 2024-01-16
OpenJDK Runtime Environment (build 17.0.10+7)
OpenJDK 64-Bit Server VM (build 17.0.10+7, mixed mode)

vemv18:02:11

has to be \"/greeting\"

1
dpsutton18:02:20

that’s a different error message than your message in #C053AK3F9 but it appears to be greeting isn’t escaped

dpsutton18:02:12

your quotation mark before greeting is correctly marked as “this is a quote in the string, not ending the string”. but the one after greeting is just ending the string rather than a quotation mark inside the string

dpsutton18:02:00

"this is text \"and this is quoted\" inside the string" note that " is used to start and end the string. So if you want them to appear inside the string you need to escape them \"

1
skyjuice18:02:03

@U11BV7MTK yep the cider-turn-on-company-mode was some errant elisp that I cleared up from the config.

dpsutton18:02:51

Is your issue cleared up then?

skyjuice18:02:39

thx all, I now have a working "website"🎉

🎉 2
🙌 1