lumo

:lumo: Standalone ClojureScript environment. Currently at version 1.9.0
phil 2018-03-09T16:01:26.000440Z

Hey all.

phil 2018-03-09T16:02:18.000951Z

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.

phil 2018-03-09T16:02:39.000651Z

Given the self-hostedness thing.

phil 2018-03-09T16:03:06.000924Z

Any docs/tips?

phil 2018-03-09T16:08:40.000440Z

I'm guessing I need to setup the normal clojurescript compiler for the project too?

mfikes 2018-03-09T16:09:09.000517Z

@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.

mfikes 2018-03-09T16:09:47.000427Z

So, just put your macro in a *.clj file and don’t use any Clojure interop and it will work.

phil 2018-03-09T16:13:12.000166Z

@mfikes Would I need to compile that first?

phil 2018-03-09T16:13:27.000432Z

Sorry, I feel like this is daft questioning.

mfikes 2018-03-09T16:13:53.000091Z

No, if you, for example (require-macros ...) on that namespace in the REPL it will compile it using the self-hosted compiler.

phil 2018-03-09T16:13:59.000758Z

Ah, amazing!

phil 2018-03-09T16:14:14.000686Z

Thanks for your help.

mfikes 2018-03-09T16:14:16.000920Z

(That’s why the code in the macro needs to be “pure”, and not rely on Clojure.)

👍 2
phil 2018-03-09T16:35:16.000428Z

All working - brilliant stuff.

snoe 2018-03-09T17:20:36.000386Z

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?