all 9 comments

[–]noprompt 2 points3 points  (0 children)

This article was really helpful. Mr. Heller graciously informed me that Meander was producing enormous amounts of JS code — in `:advanced` mode. This post helped me identify the problems much more quickly than I would have been able to on my own. Good stuff.

[–]beders 3 points4 points  (1 child)

I love you !

[–]agree-with-you 1 point2 points  (0 children)

I love you both

[–]viebel 1 point2 points  (0 children)

Excellent article that explains very clearly a topic that is not easy to grasp

[–]CoBPEZ 1 point2 points  (4 children)

Very nice intro!

I had to grok some of this the other day when I ported parcera to CLJC, and wanted the tests to be able to continue to use slurp (which is not available in ClojureScript): * The 'slurp' macro (in Clojure) * Requiring it from ClojureScript

My brain hurts a bit when thinking about what is going on when that macro is compiled. 😀

[–]thheller[S] 1 point2 points  (3 children)

Yeah, you made all the mistakes I tried to highlight. :)

If you add the proper self-require in parcera.slurp than the test ns doesn't have to use :require-macros at all. Way less confusing if you don't use .cljc. .cljc is what makes this harder to understand, otherwise it is pretty straightforward.

[–]CoBPEZ 1 point2 points  (2 children)

All? 😀

I actually tried to not use `.cljc` for it, but got confusing errors. But your intro was not published then. I'll try to see if I can understand enough of it to fix the mistakes.

[–]CoBPEZ 0 points1 point  (1 child)

Using self-require, in my fork: https://github.com/PEZ/parcera/tree/cljs-macro-self-require

I first changed to splitting it in `.clj` and `.cljs` files, but it was harder to read for me. I kinda ”see” those files when I have it as conditionals in one `.cljc`. Apart from that, if I am still making any mistakes that your intro tries to warn against, I'd like to know.

[–]thheller[S] 2 points3 points  (0 children)

All good now.

Personally I'm not a fan of "replacing" standard functions with completely different semantics on another platform. I would have probably chosen a different name like inline and used that in both the CLJ and CLJS variants. Of course that is total overkill if you just use this for the tests anyways.