@dominicm The above might be a solution for your custom try+ macro. Wanna give it a try?
Interesting! I'll share this with #meander and see what comes up
@borkdude is there a solution for when you don't know the type, or calculating the actual code form would be costly? My first thought is just to bind to nil
@dominicm That might result in unused bindings, etc.
Hmm. I guess that matching does check for the presence of the key as well...
So I guess I'd need to implement a subset of meander in sci to get kondo to work with it
yes, that's the idea. implement a function which expands into something that clj-kondo understands, which mimics the real macro
@dominicm I believe I have one for slingshot here:
I think step 1 is implementing meander. Then try/catch should be easy
Personally I think this will be a powerful feature. You can even throw exceptions when validating the macro input.
@dominicm In case you, or anyone else wants to play with this, here is some info: https://github.com/borkdude/clj-kondo/issues/811
maybe @seancorfield would also be interested in this, since you recently wrote custom analyzers for jdbc macros which could now be done in user-space with the above.
I'll take a look when I'm back at work tomorrow. I haven't been following the discussion today.
thanks!
Wouldn't most macroexpand passed to :macroexpand just be the macro code as is?