Fork me on GitHub

@viebel decided to take another look at my macro related issue, and here's something interesting I've found:


if I explicitly require the ns which declares the macro, it works

Yehonathan Sharvit14:02:01

I’m a bit out of context

Yehonathan Sharvit14:02:10

Could you please refresh my memory


implicit macro loading in self-hosted context, with klipse

Yehonathan Sharvit14:02:16

I rememeber the general topic

Yehonathan Sharvit14:02:26

But what was the specific issue

Yehonathan Sharvit14:02:38

I remember somethign that was running fine on lumo but failed on klipse


take a look at the github project I linked, 2 really short namespaces


namespace a defines a macro x and loads it implicitly


namespace b loads a, refers and uses x


but on klipse, for some reason, b loads the function x, not the macro


what I've discovered now may be a hint to you, since you're familiar with how klipse loads / compiles / evals namespaces

Yehonathan Sharvit14:02:05

and I’m verry thankful to you

Yehonathan Sharvit14:02:14

Will try to see if it helps

Yehonathan Sharvit14:02:32

What is your exact use case?

Yehonathan Sharvit14:02:48

I mean in what context do you want to load your library inside klipse?


I'd like to use klipse with codox


for a library I develop

Yehonathan Sharvit14:02:21

I think that if you use the caching feature of the klipse theme it should work


I'll take a look at that


@viebel 2 things: first, it seems to work now (and is also a lot faster!), but klipse tries to evaluate the initial expressions before the require-statement is evaluated. Second, despite working with lumo, the way klipse loads namespaces is probably still messed up somehow


also, thanks for the help once again 🙂

Yehonathan Sharvit17:02:48

1. Can you upload somewhere the html where you see that the initial expressions are evaluated before require-statement?

Yehonathan Sharvit17:02:42

2. 100% agree - Still hoping to solve it. I tried to add ?verbose=1 in order to see the exact loading of the namespaces. But still wasn’t able to solve it


it's pretty easy to guess why it happens: my require-statement takes longer than 3 seconds, which I believe is the delay for auto evaluation


re-evaluate the second block, the first one isn't properly required yet


i.e. go for defschema

Yehonathan Sharvit17:02:03

Could you add a (js/console.log “a”) in the require snippet and (js/console.log “b”) into the 2nd snippet?

Yehonathan Sharvit17:02:06

And I’m in the train with a very bad cellular network

Yehonathan Sharvit17:02:22

Write whatever you discover here and I’ll take a look when I get home

Yehonathan Sharvit17:02:46

Oh, I see that the require statement failed

Yehonathan Sharvit17:02:03

you can make it visible from the browser console

Yehonathan Sharvit17:02:15

#error {:message "No such macros namespace: cljs.spec, could not locate cljs/spec.clj or cljs/spec.cljc", :data {:tag :cljs/analysis-error}}

Yehonathan Sharvit17:02:01

But if I re-eval the require statement, the error disappears


hmm, I don't see that in the console

Yehonathan Sharvit17:02:09

I mean, in the browser dev tools


the only errors I get are "use of undeclared var ..."