Checking Clojure pre-conditions without running the function?
问题 I have one function that does some (possibly lengthy) work (defn workwork [x] ...) and some other functions to check if the call will succeed ahead of time (defn workwork-precondition-1 [x] ...) . The precondition functions should be evaluated every time workwork is called (e.g. using :pre ). The precondition functions should also be collected (and:ed) in a single function and made available to client code directly (e.g. to disable a button). Which is the idiomatic way to solve this in