Clojure for the brave and true error in chapter 6?

I am currently reading Clojure for the Brave it’s a fantastic book to learn clojure.
I think there is an error in chapter 6 where refer is used like so:

(refer 'the-divine-cheese-code.visualization.svg :as :only ['points])

but I can’t find the errata of the book.
Is it really an error or am I missing something ?

I think you are right.

user> (require 'clojure.string)
user> (refer 'clojure.string :as :only ['starts-with?])
IllegalArgumentException No value supplied for key: [starts-with?]  clojure.lang.PersistentHashMap.create (

You might as well omit :as.

Amazing! A glitch, in the book since 2015!

FWIW, it was reported in the Google Group back in September 2017!topic/braveclojure/cveM378fY9Y

1 Like

Thanks for the link. It’s not fixed even in the online version of the book.
Good book anyway.

Hey! Slightly off topic, but mind sharing how you marked Phil’s reply as the solution?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.