Liking cljdoc? Tell your friends :D
Clojure only.

nrepl.middleware.pr-values


pr-values

(pr-values handler)

Middleware that returns a handler which transforms any :value slots in messages sent via the request's Transport to strings via the provided :printer function, delegating all actual message handling to the provided handler.

If no custom printer is set, this falls back to using print-dup or print-method. The function will be called with the value and any resolved :print-options from the message.

Requires that results of eval operations are sent in messages in a :value slot.

If :value is already a string, and a sent message's :printed-value slot contains any truthy value, then :value will not be re-printed. This allows evaluation contexts to produce printed results in :value if they so choose, and opt out of the printing here.

Middleware that returns a handler which transforms any `:value` slots in
messages sent via the request's `Transport` to strings via the provided
`:printer` function, delegating all actual message handling to the provided
handler.

If no custom printer is set, this falls back to using `print-dup` or
`print-method`. The function will be called with the value and any resolved
`:print-options` from the message.

Requires that results of eval operations are sent in messages in a
`:value` slot.

If `:value` is already a string, and a sent message's `:printed-value` slot
contains any truthy value, then `:value` will not be re-printed.  This allows
evaluation contexts to produce printed results in `:value` if they so choose,
and opt out of the printing here.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close