Hey all.
I've been using Lumo for a little internal project and it's been brilliantly simple so far. However, I'm at the point I need ("need") to write a macro, I've honestly no idea how though.
Given the self-hostedness thing.
Any docs/tips?
I'm guessing I need to setup the normal clojurescript compiler for the project too?
@phil You can write macros just as you would with JVM ClojureScript. The only difference is that the macro namespace will be compiled as ClojureScript instead of Clojure.
So, just put your macro in a *.clj
file and don’t use any Clojure interop and it will work.
@mfikes Would I need to compile that first?
Sorry, I feel like this is daft questioning.
No, if you, for example (require-macros ...)
on that namespace in the REPL it will compile it using the self-hosted compiler.
Ah, amazing!
Thanks for your help.
(That’s why the code in the macro needs to be “pure”, and not rely on Clojure.)
All working - brilliant stuff.
Hey all. I’m trying to run a script that is doing a (js/require "dep")
that is installed in my project root from npm install. I would like to run lumo from outside the project however and dep
cannot be found, is there a way to specify where to look for node_modules or set a working dir?