Structural correctness while refactoring in Clojure -
if project using "person" maps shape {:firstname :lastname :address}
, , want change shape {:name {:firstname :lastname} :address}
, can ensure i've made corresponding changes everywhere these objects used?
in java, it's straightforward anywhere still have person.firstname issue compile error. in clojure might not runtime error, bad data saved server. assume it's not possible guarantee correctness, there other fine-toothed-combs?
clojure has libraries provide data definition , validation. example, use https://github.com/prismatic/schema
regarding difficulty of compile-time vs. runtime errors...well, issue not unique clojure. quote john carmack: "the challenge of lisp getting program run, challenge of haskell getting compile."
Comments
Post a Comment