Fork me on GitHub

Does someone have an example of importing macros in lumo or cljs in general from a .cljfile? It looks to me that the threading macro is taken from clojure.core so there must be a way.


ah ok :require-macros with :refer to the function/macro name works!


Trying to make a sense of things, can it be that macros are stored on the cache and when evaluated in the repl, are read from fileio synchronously. For two equal commands, one with function only, other with macro, the macro call will block other processes (for like <0.1sec) and the function will not.


I notice this because Im making music app with lumo, and I can send function call to lumo repl multiple times of second without the music stopping for even a ms, but a macro is really blocking the whole process.


@hlolli yes, I think that is part of how the compiler works, it is not a self-host issue (but Antonio might shed more light on this)


I ended up throwing some macros, I was trying to translate an underscore _ to -1 with macro and some symbols, but makes more sense to just quote. Maybe this had nothing to do with macros. If it did, then macros that clojurescript requires must produce the same block, but it didn't in my case (like using -> macro didn't block anything).


uhm interesting yeah, I noticed that the execution blocks at the repl while compiling ns forms but I have never asked myself if it is because of just makes sense to me that it blocks there loading namespaces...anyways, I really don't know that much about that part of the compiler. In replumb I block and don't return anything until ready (that is, when the compiler callback returns something)