This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The question was asked why I (as a programmer who prefers dynamic languages) don't consider static types "worth it". Here | |
is a short list of what I would need from a type system for it to be truely useful to me: | |
1) Full type inference. I would really prefer to be able to write: | |
(defn concat-names [person] | |
(assoc person :full-name (str (:first-name person) | |
(:second-name person)))) | |
And have the compiler know that whatever type required and produced from this function was acceptible as long as the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def ^:dynamic *indent* 0) | |
(alter-var-root | |
#'clojure.core/load | |
(fn [orig] | |
(fn [& paths] | |
(let [t (System/nanoTime) | |
r (binding [*indent* (inc *indent*)] | |
(apply orig paths))] | |
(binding [*out* *err*] | |
(println (apply str (repeat *indent* " ")) (/ (- (System/nanoTime) t) 1000000.0) paths) |