3 ms·
Please take this in the ha-ha-only-serious spirit: I wonder if a static type system would have caught the error in this case...?
by lomnakkus 12y ago
Please take this in the ha-ha-only-serious spirit: I wonder if a static type system would have caught the error in this case...?
- pi-rat 12y agoProbably not unless you make k-p, k-i, k-d types - as they are simply floats. Checking for unused function arguments however would have caught this error. Running a linter (such as eastwood) in clojure does the trick: $ lein eastwood '{:linters [:unused-fn-args]}' == Eastwood 0.1.4 Clojure 1.7.0-alpha2 JVM 1.8.0_05 == Linting pid.core == {:linter :unused-fn-args, :msg "Function args [k-p (line 32, column 33)] of (or within) pid-transducer are never used", :file "pid/core.clj", :line 32, :column 1} Sadly it only works if you actually use it, and I'm a lazy bastard :p
- lemming 12y agoIf you used Cursive, it would have marked that parameter as unused right in your editor. Even lazy bastards get the advantages!