4 ms·
Pre/post conditions at compile-time in Clojure? Nope. How could you know the value returned by a function at compile time? Or the value of the inputs? You coul
by Kototama 15y ago
Pre/post conditions at compile-time in Clojure? Nope. How could you know the value returned by a function at compile time? Or the value of the inputs?
You could only know the types of the input if the compiler was smart enough and define constraints on the types but as far as I know it's not possible in Clojure.
- lucian1900 15y agoYou're right, Clojure doesn't support compile-time conditions. Must've been confused.
- jshen 15y agotrue, but there are a lot of things you can catch with pre/post conditions in clojure that you wouldn't catch with a compiler in something like java.