Fork me on GitHub
#lumo
<
2017-03-19
>
hlolli11:03:55

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.

hlolli11:03:27

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

hlolli13:03:52

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.

hlolli13:03:43

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.

richiardiandrea18:03:21

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

hlolli18:03:18

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

richiardiandrea18:03:19

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 macros...it 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)