Re: Check if value is a ring handler

2016-01-29 Thread Atamert Ölçgen
You can check for a valid response using ring.util.response/response? (obviously requires calling the function in question) On Wed, Jan 27, 2016 at 7:42 AM, JvJ wrote: > Is there a way to dynamically check whether or not a given function > qualifies as a ring handler? > > -- > You received this

Re: Check if value is a ring handler

2016-01-27 Thread James Reeves
On 27 January 2016 at 05:42, JvJ wrote: > Is there a way to dynamically check whether or not a given function > qualifies as a ring handler? > Nope. Clojure isn't statically typed, so you can't determine that a function always returns a value of a particular type. - James -- You received this

Re: Check if value is a ring handler

2016-01-27 Thread Matching Socks
(constantly nil) would work as a Ring handler. The str function also would work as a Ring handler. But it might be unclear (in a context where either a Ring handler, or a function for some other purpose, was acceptable) whether these were intended as Ring handlers -- You received this mes