Programming Clojure, Fourth Edition: General Introduction defn blank (p. 4)

I mentioned this in a Discord and someone pointed out to me it’s a Clojure version problem.

The code works fine in 1.12.5

Clojure 1.12.5
(defn blank? [str]
  (every? Character/isWhitespace str))
#'user/blank?
(def blank-string "")
#'user/blank-string
(blank? blank-string)
true
user=>

But you do get an error with 1.10

 lein repl
OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
nREPL server started on port 39471 on host 127.0.0.1 - nrepl://127.0.0.1:39471
REPL-y 0.4.3, nREPL
Clojure 1.10.1
OpenJDK 64-Bit Server VM 19.0.2+7-Ubuntu-0ubuntu322.04
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

user=> (defn blank? [str]
  #_=>   (every? Character/isWhitespace str))
Syntax error compiling at (REPL:2:3).
Unable to find static field: isWhitespace in class java.lang.Character

So that suggests the only issue I had was the source I downloaded was out of sync with that in the book. I just redownloaded the source now and it is correct in the introduction.clj

I attempted to learn Clojure a while ago and started with lein so returned to it thinking Clojure was relatively stable so code examples should work between versions.

So we’re all good at the moment just use clj or clojure > 1.12 and you’ll be fine.