Other
is a more complex version (wrapping) of What
. It does what What
does but much more. I took care to define 2 namespaces.
(ns what)
(defprotocol IWhatever
(whatever [this]))
(deftype What []
IWhatever
(whatever [this]
(str "whatever")))
(whatever (->What))
(ns other (:require what))
(deftype Other []
what/IWhatever
(whatever [this]
(what/whatever (what/->What))))
(whatever (->Other)) ;bad line
The error is:
clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Unable to resolve symbol: whatever in this context, compiling:(C:\...)
Why won't this last expression resolve? It's like the name can't be found, but as you can see I redefined it under the current namespace.
It's nonsense code but I used the simplest example of the problem to illustrate the point. I'm running this in LightTable if that's relevant.