I would like to make my existing Clojure libraries usable from clojurescript as well as create new applications which run in both Clojure and Clojurescript.
I understand Clojure and Clojurescript have their differences, and that there are metaprogramming solutions such as cljx. But, I have limited my Clojure code to a compatible subset of Clojurescript and I would simply like to call clojure from clojurescript (and possibly vice-versa). I have seen this possible in libraries such as core.match, but I am unable to replicate what is done there.
I am currently getting No such namespace
, I am not sure if it is because it is not possible, or because my namespacing or directory structure is wrong, or some other reason.
For concreteness, I have a directory structure of the form
src/
clj/
clopjys/
vector.clj
cljs/
cljdemo.cljs
I am trying to use vector.clj from within cljdemo.cljs, i.e:
(:require
[clophys.vector :refer [coords std-uniform-vector]])
My project.clj has the following entries
...
:source-paths ["src/clj"]
:cljsbuild {
:builds [{
; The path to the top-level ClojureScript source directory:
:source-paths ["src/cljs"]
...