The root cause of this is that prev-body will be nil when the protocol doesn't already exist, which will be equal to the body when just the name is present.
We can avoid this by just adding a docstring, as the REPL session above shows, but ideally defprotocol+ would behave in the same way as defprotocol from clojure.core. See http://dev.clojure.org/jira/browse/CLJ-966
Our use case for this was somewhat odd; we basically have a protocol that we want to remove but it still needs to be resolvable. The only usages were inside a macro that we control, so we can just get rid of it and substitute something else, but we still need to have a Var and a class of the same name that are resolvable.
When defprotocol+ is called with just a name the protocol isn't actually created.
The root cause of this is that prev-body will be nil when the protocol doesn't already exist, which will be equal to the body when just the name is present.
We can avoid this by just adding a docstring, as the REPL session above shows, but ideally defprotocol+ would behave in the same way as defprotocol from clojure.core. See http://dev.clojure.org/jira/browse/CLJ-966
Our use case for this was somewhat odd; we basically have a protocol that we want to remove but it still needs to be resolvable. The only usages were inside a macro that we control, so we can just get rid of it and substitute something else, but we still need to have a Var and a class of the same name that are resolvable.