I was asking how you would conform a value to a falsey value. If the interface for the function is that returning nil or false means that the input is not valid (which is what I understood from the discussion) then how can you conform to nil or false? However, on reading the docs for conformer that you posted here, it suggests that returning falsey values does not mean that they are invalid, only :clojure.spec/invalid means that. So apologies for the misunderstanding. I was away from a computer that I could reasonably run a REPL on, so I just asked rather than tested ;)
Many thanks, Ed On Thursday, 1 September 2016 00:31:43 UTC+1, Alex Miller wrote: > > user=> (doc s/conformer) > ------------------------- > clojure.spec/conformer > ([f] [f unf]) > Macro > takes a predicate function with the semantics of conform i.e. it should > return either a > (possibly converted) value or :clojure.spec/invalid, and returns a > spec that uses it as a predicate/conformer. Optionally takes a > second fn that does unform of result of first > > Conformers are expected return either a value or ::s/invalid if invalid. > > > On Wednesday, August 31, 2016 at 6:29:23 PM UTC-5, Alex Miller wrote: >> >> I don't understand the question. What are you trying to do? >> >> On Wednesday, August 31, 2016 at 4:08:00 PM UTC-5, l0st3d wrote: >>> >>> So how would you conform something to nil or false? For example: >>> >>> (s/conform (s/conformer read-string) "nil") >>> >>> ? >>> >>> -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.