When you import a library some of the names in it may overlap with the built-ins which leads to warnings like the following ones:
WARNING: reverse already refers to: #'clojure.core/reverse in namespace: clojure.fcc.find-longest-word, being replaced by: #'clojure.string/reverse
WARNING: replace already refers to: #'clojure.core/replace in namespace: clojure.fcc.find-longest-word, being replaced by: #'clojure.string/replace
This in turn results in Exit code: 1 and counts as a test failure.
For example, the next 2 solutions work:
(ns clojure.fcc.find-longest-word
(:use [clojure.string :only (split)]))
(defn find-longest-word [s]
(reduce max (map count (split s #"\s+"))))
(ns clojure.fcc.find-longest-word)
(defn find-longest-word [s]
(reduce max (map count (clojure.string/split s #"\s+"))))
While this solution doesn't:
(ns clojure.fcc.find-longest-word
(:use [clojure.string :as s]))
(defn find-longest-word [s]
(reduce max (map count (s/split s #"\s+"))))
When you import a library some of the names in it may overlap with the built-ins which leads to warnings like the following ones:
This in turn results in
Exit code: 1
and counts as a test failure.For example, the next 2 solutions work:
While this solution doesn't: