Add a macros.clj to the project
magomimmo opened this issue · 1 comments
It often happens that a CLJS lib needs macros. CLJS does not directly support macros and if a CLJS lib needs them, they are confined in a CLJ file which is compiled down by the CLJ compiler and the resulting namespace is made available to a CLJS code through the :require-macros
namaspace directive in the CLJS calling namespace.
Most of the current CLJS libs put a macros.clj
file in a CLJS source directory, which I don't like, because this breaks the separation of concerns principle.
Any macros.clj
files should be put in a CLJ directory.
To support macros we do not need any special extension. Just document in the README.md
file that if a lib requires macros and/or compile-time only functions, those have to be written in files hosted in the src/clj
pathname.