Web Development with Clojure, Third Edition: Omitted `var` (page 38)

After the introduction of of muuntaja the -main function changes from

(defn -main []
(jetty/run-jetty
(-> handler
var
wrap-nocache
wrap-reload)
{:port 3000
:join? false}))

to

(defn -main []
(jetty/run-jetty
(-> #'handler
wrap-nocache
wrap-formats
wrap-reload)
{:port 3000
:join? false}))

The handler is no longer turned into a var which defeats the purpose of wrap-reload (which is still present). Possibly a slip worth being corrected.

Thanks for this great book!

1 Like

Good catch, thanks! we’ll update in the next release.

2 Likes

You’re quick, thanks. JFYI: As I’m working through the book I’ve found the same omission on p. 42, so maybe there’s more. Cheers!

1 Like

Hi, we replace (-> handler var ...) with (-> #'handler ...). This does the exact same thing, but uses the #' syntax sugar instead of calling var explicitly. We’ve added an explanation of this syntax to clarify.

Hope this helps!

1 Like