making a non-op middleware discoverable

41 views
Skip to first unread message

Laurent PETIT

unread,
Apr 29, 2015, 3:33:42 PM4/29/15
to clojur...@googlegroups.com
Hello,

`cider-nrepl` provides the `wrap-pprint` middleware.

`wrap-pprint` does not declare a new op, but rather enhances the `eval` op by pprinting the value of the `:eval` slot to the output stream.

Nevertheless, I'd like to be able, on the client-side of nrepl, to discover whether the `wrap-pprint` middleware is active or not.

At first, I tried to change its description so that it exposes a fake `pprint-middleware` op:

but this does not seem to work - or be sufficient, because then it seems I lose the pprint middleware feature.

If someone can please help me understand what I'm doing wrong

--
Laurent Petit

Chas Emerick

unread,
Apr 30, 2015, 11:12:06 PM4/30/15
to clojur...@googlegroups.com
Looking at your gist, you've moved the :requires and :expects metadata within the map for the dummy "pprint-middleware" map. Those should be peer keys of :handles.

IIRC, you're right that there's no easy way to identify whether particular middlewares are installed. The "describe" output is pretty strictly operation-related. That's probably worth a JIRA ticket.

- Chas
--
You received this message because you are subscribed to the Google Groups "clojure-tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-tool...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Laurent PETIT

unread,
May 1, 2015, 1:49:25 AM5/1/15
to clojur...@googlegroups.com
Hi Chas, thanks for your answer. I'll open a JIRA ticket. 

Cheers,

Laurent


--
Laurent Petit

Laurent PETIT

unread,
May 1, 2015, 8:18:49 AM5/1/15
to clojur...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages