CLJC optimized imports with macros

4 views
Skip to first unread message

Micah Martin

unread,
Jul 29, 2022, 1:37:23 PM7/29/22
to cur...@googlegroups.com
When working with CLJC files that use macros I often have to use the following structure in my ns namespace.  This confuses Cursive’s imports optimizer, which means I have to optimize my own imports.  Ugh!  Makes me wonder how I got by without Cursive’s imports optimizer in the first place.  

Is there there an alternate structure that Cursive would be happy with (and that doesn’t duplicated the refer list)?  Or could Cursive be taught to understand this structure?

(:require [speclj.core #?(:clj :refer :cljs :refer-macros) [describe it should=]] …)

Thanks!

Micah

Colin Fleming

unread,
Aug 1, 2022, 2:09:34 AM8/1/22
to Cursive Group
Yes, currently Cursive will not optimise ns forms containing reader conditionals. I'm planning to improve this soon, such that the sub-forms without conditionals will be optimised and the others ignored, and then finally to manually fix a bunch of common cases (including yours) so that it should work for most ns forms. Hopefully in this EAP series, but no promises on that one.
--
You received this message because you are subscribed to the Google Groups "Cursive" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cursive+u...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages