I'm trying to write a macro for use from ClojureScript to handle file I/O for a Reagent app. I get this error:
IllegalArgumentException: No implementation of method: :as-file of protocol: #'clojure.java.io/Coercions found for class: clojure.lang.Symbol
When I try to do the following:
(def file-string "/Users/luciano/Dropbox/projects/test/resources/blog/test.md")
(get-file file-string)
But I can do this just fine:
(get-file "/Users/luciano/Dropbox/projects/test/resources/blog/test.md")
This is the macro:
(defmacro get-file [fname]
(slurp (io/file fname)))
What am I doing wrong here?