I'm trying out squint's (warn-on-lazy-reusage!).
I put one at the top of each source - like I would for (set! *warn-on-reflection* true) in clojure sources. Bad idea? Perf impact?
I assumed (wrongly) that I would see warnings at compile time, but instead I happened to notice warnings logged to my browser console at runtime.
Anyhoo, happy to update the squint README on this topic when I learn a bit more about it.
Thanks! Q: should this only be used in dev or is it ok to leave in for production?
good question, let me check
it's fine to do it in production as there is no to little overhead. on the other hand lazy re-usage isn't incorrect, it's just slower since things will be re-calculated. so you might have an error in production that could just be an unoptimal but correct behavior
oh it's just logging. this is weird code: https://github.com/squint-cljs/squint/blob/76e57aea3a870181b6ec89e6f1e43eba5bc90400/src/squint/core.js#L695-L698
it throws and then immediately catches it.. weird :)
oh it's because of the stack
Cool, tx, that’s enough info for my PR.
PR welcome!