When using clojure.string, I receive the following warnings
WARNING: replace already refers to: #'clojure.core/replace in namespace: tutorial.regexp, being replaced by: #'clojure.string/replace
WARNING: reverse already refers to: #'clojure.core/reverse in namespace: tutorial.regexp, being replaced by: #'clojure.string/reverse
my clojure script is:
(ns play-with-it
(:use [clojure.string]))
Is there any way to fix those warnings?
Yes, switch to
and then say e.g.
to call
clojure.string‘sreplacefunction.With
:use, you bring in all Vars fromclojure.stringdirectly into your namespace, and since some of those have names clashing with Vars inclojure.core, you get the warning. Then you’d have to sayclojure.core/replaceto get at what’s usually simply calledreplace.The clash of names is by design;
clojure.stringis meant to berequired with an alias like this.strandstringare the most frequently chosen aliases.