making a non-op middleware discoverable

已查看 41 次
跳至第一个未读帖子

Laurent PETIT

未读,
2015年4月29日 15:33:422015/4/29
收件人 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

未读,
2015年4月30日 23:12:062015/4/30
收件人 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

未读,
2015年5月1日 01:49:252015/5/1
收件人 clojur...@googlegroups.com
Hi Chas, thanks for your answer. I'll open a JIRA ticket. 

Cheers,

Laurent


--
Laurent Petit

Laurent PETIT

未读,
2015年5月1日 08:18:492015/5/1
收件人 clojur...@googlegroups.com
回复全部
回复作者
转发
0 个新帖子