Web Development with Clojure, Third Edition: truncated ]) (Page 1100

I think the last line of the code example on page 110 is missing a closing bracket and end parens.

Should be:
{:errors {:server-error [“Failed to save message!”]}}))))))}}]])

In the source code, it appears like this:
{:errors {:server-error [“Failed to save message!”]}}))))))}}]
;
])

Thanks for the great book! It’s been instrumental in understanding of practical Clojure.

1 Like

Hi there, we’ve included only the brackets and parentheses for the relevant s-expression in order to ensure that they are all balanced.

Since this is a single reitit route declaration, it is the vector ["/message" ...] which is meant to be inserted into (defn service-routes [] ["/api" ... ]) wherever the reader wishes. We just happened to insert it at the end in the source. The closing bracket and parenthesis are part of the outer function and vector so they are not included.

Hope this helps. Glad you’re enjoying the book. Thanks for reading!

1 Like