Fork me on GitHub
#klipse
<
2017-02-13
>
moxaj14:02:58

@viebel decided to take another look at my macro related issue, and here's something interesting I've found: https://tinyurl.com/hsmx6we

moxaj14:02:31

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

moxaj14:02:30

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

moxaj14:02:21

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

moxaj14:02:30

namespace a defines a macro x and loads it implicitly

moxaj14:02:52

namespace b loads a, refers and uses x

moxaj14:02:22

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

moxaj14:02:44

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?

moxaj14:02:02

I'd like to use klipse with codox

moxaj14:02:12

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

moxaj14:02:51

I'll take a look at that

moxaj17:02:57

@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

moxaj17:02:12

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

moxaj17:02:19

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

moxaj17:02:54

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

moxaj17:02:08

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

moxaj17:02:51

hmm, I don't see that in the console

Yehonathan Sharvit17:02:09

I mean, in the browser dev tools

moxaj17:02:25

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