klipse

moxaj 2017-02-13T14:29:58.000837Z

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

moxaj 2017-02-13T14:30:31.000838Z

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

Yehonathan Sharvit 2017-02-13T14:31:01.000839Z

I’m a bit out of context

Yehonathan Sharvit 2017-02-13T14:31:10.000840Z

Could you please refresh my memory

moxaj 2017-02-13T14:31:19.000841Z

sure

moxaj 2017-02-13T14:31:30.000842Z

implicit macro loading in self-hosted context, with klipse

moxaj 2017-02-13T14:32:06.000843Z

demonstrated with https://github.com/moxaj/klipse-test/tree/master/src/klipse_test

Yehonathan Sharvit 2017-02-13T14:35:16.000845Z

I rememeber the general topic

Yehonathan Sharvit 2017-02-13T14:35:26.000846Z

But what was the specific issue

Yehonathan Sharvit 2017-02-13T14:35:38.000847Z

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

moxaj 2017-02-13T14:36:21.000849Z

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

moxaj 2017-02-13T14:36:30.000850Z

namespace a defines a macro x and loads it implicitly

moxaj 2017-02-13T14:36:52.000851Z

namespace b loads a, refers and uses x

moxaj 2017-02-13T14:37:22.000852Z

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

Yehonathan Sharvit 2017-02-13T14:38:06.000853Z

Now I remember

moxaj 2017-02-13T14:39:44.000854Z

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

Yehonathan Sharvit 2017-02-13T14:39:56.000855Z

I hope so

Yehonathan Sharvit 2017-02-13T14:40:05.000856Z

and I’m verry thankful to you

Yehonathan Sharvit 2017-02-13T14:40:14.000857Z

Will try to see if it helps

Yehonathan Sharvit 2017-02-13T14:40:32.000858Z

What is your exact use case?

Yehonathan Sharvit 2017-02-13T14:40:48.000859Z

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

moxaj 2017-02-13T14:41:02.000860Z

I'd like to use klipse with codox

moxaj 2017-02-13T14:41:12.000861Z

for a library I develop

Yehonathan Sharvit 2017-02-13T14:41:56.000862Z

Oh. I remember

Yehonathan Sharvit 2017-02-13T14:42:21.000863Z

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

Yehonathan Sharvit 2017-02-13T14:42:21.000864Z

https://github.com/viebel/codox-klipse-theme#performances-and-caching

moxaj 2017-02-13T14:45:51.000866Z

I'll take a look at that

moxaj 2017-02-13T17:28:57.000867Z

@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

moxaj 2017-02-13T17:29:12.000868Z

also, thanks for the help once again 🙂

Yehonathan Sharvit 2017-02-13T17:30:48.000869Z

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

Yehonathan Sharvit 2017-02-13T17:31:42.000870Z

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

moxaj 2017-02-13T17:31:52.000871Z

you can see it happen here: http://moxaj.github.io/mikron/mikron.core.html

moxaj 2017-02-13T17:32:19.000872Z

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

moxaj 2017-02-13T17:32:54.000874Z

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

moxaj 2017-02-13T17:33:08.000875Z

i.e. go for defschema

Yehonathan Sharvit 2017-02-13T17:35:03.000876Z

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

Yehonathan Sharvit 2017-02-13T17:37:06.000877Z

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

Yehonathan Sharvit 2017-02-13T17:37:22.000878Z

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

moxaj 2017-02-13T17:37:30.000879Z

alright

Yehonathan Sharvit 2017-02-13T17:38:46.000880Z

Oh, I see that the require statement failed

Yehonathan Sharvit 2017-02-13T17:39:03.000881Z

you can make it visible from the browser console

Yehonathan Sharvit 2017-02-13T17:39:15.000882Z

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

Yehonathan Sharvit 2017-02-13T17:40:01.000883Z

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

moxaj 2017-02-13T17:40:51.000884Z

hmm, I don't see that in the console

Yehonathan Sharvit 2017-02-13T17:41:09.000885Z

I mean, in the browser dev tools

moxaj 2017-02-13T17:43:25.000887Z

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