clojure - Accessing defrecord methods in ClojureScript Figwheel -
i have code in cljc files compiles both clojure , clojurescript.
in protocols.cljc
(defprotocol transformable ".." (scale [this scalar] "" ) ...)
in pattern.cljc
(defrecord apattern [paths] transformable (scale [this s] (...)) ...)
in another.cljc
(defn f [pattern] (.scale pattern (/ 1 2)) )
and in core.cljs
(another/f pattern)
however, i'm getting error on browser console
typeerror: pattern.scale not function
checking fields of pattern object in core.cljs (using js-keys) shows me object has called
"patterning$protocols$transformable$scale$arity$2"
which looks function. doing wrong access in clojurescript? . notation not work? need else?
calls protocol functions calls other function. f
function should like:
(require 'protocols) (defn f [pattern] (protocols/scale pattern (/ 1 2)) )
Comments
Post a Comment