Fork me on GitHub
#cursive
<
2023-01-11
>
helios06:01:16

Any advice in how to teach cursive about how to resolve this macro?

(deflambda :a/keyword
 {option-map}
 [args]
 body)

serioga07:01:53

Looks like defn

helios08:01:32

resolving it like a defn doesn't help unfortunately 😞

serioga08:01:11

what library is that?

helios08:01:32

custom macro, no library

helios08:01:44

(defmacro deflambda
  [dispatch-val metadata fn-binding & fn-body]
  `(let [metadata# (assoc ~metadata :handler ~dispatch-val)]
    (. ~(with-meta 'ductile.lambda/handle {:tag 'clojure.lang.MultiFn})
       addMethod
       ~dispatch-val
       (with-meta
         (fn [req#] (enter-chain req# metadata# (fn [~@fn-binding] ~@fn-body)))
         metadata#))))

serioga09:01:33

> resolving it like a defn doesn't help unfortunately well, it does not work because :foo/bar is keyword not symbol...

serioga09:01:00

Seems only solution is to resolve as None to suppress Cursive warning.

Joe R. Smith16:01:19

Why not just accept a symbol? It can still be ns-qualified (nd since it's a macro, you can do whatever w/ it in the macro body)

Joe R. Smith16:01:44

I do that for some of my macros- cursive doesn't care if the symbol has a namespace, e.g.:

Sam Adams18:01:07

Is there currently any way to get Run test under carat in REPL working with a defspec test? I see this issue was closed: https://github.com/cursive-ide/cursive/issues/632. Resolving as deftest doesn't seem to work