Web Development with Clojure, Third Edition: Use of `var` (page 34)

Hi,

during reading of Chapter 2 I somehow got a little bit confused in regards to the note given at the end of the page which states:

“Note that we have to create a var from the handler in order for this middleware to work”

Given that I’m a beginner Clojure developer this information alone didn’t make too much sense to me until I found the following post on StackOverflow: https://stackoverflow.com/questions/39550513/when-to-use-a-var-instead-of-a-function which is similar to the same paragraph from the book.

So maybe clarification of the why or links to suggested further reading on the topic could spare the readers some time searching the web.

1 Like

Thanks for the note! We’ve re-worded our paragraph and added footnotes linking to clojure documentation on vars and evaluation. Will be included in the next beta release.

2 Likes