Fork me on GitHub
#cursive
<
2023-01-10
>
markbastian03:01:37

I have an interesting issue and I'm not sure if it's Cursive or Clojure. I have this protocol:

(defprotocol IOutbox
  (outbox-write! [this event])
  (outbox-read [this])
  (outbox-get [this event])
  (outbox-delete! [this event]))
The implementation looks like this

cfleming05:01:19

That issue is Cursive mistaking that line for an invocation. Which version of Cursive are you running?

cfleming05:01:49

Also, what is the form there, is it a deftype, defrecord, or something else with similar syntax?

markbastian05:01:33

1.12.7-eap1-2022.3

markbastian05:01:30

In the code above, I have the following setup: 1. The IOutbox protocol is defined in one ns. 2. In the displayed ns there is a record: (defrecord RefChat [db outbox]) 3. The above snippet is in a extend-type RefChat form and is one of the extended types.

serioga07:01:19

Does this implementation work? I've never seen implementing function names with namespaces...

imre13:01:07

Yeah I think you are only supposed to use the namespace part with the protocol itself

imre13:01:45

planex-api/IOutbox
(outbox-write! ...

markbastian14:01:05

It does work. TIL....

markbastian14:01:37

And yes, removing the ns part fixes everything.

2
👍 2
imre14:01:39

I recall running into this every now and then

markbastian03:01:19

Notice the red line. It says "Incorrect arity 2 for" that method. Any idea what's up with that?