read


read
or learn more

clojure.spec: Data Design 01 – Sketching a Struct

Feb 10, 2017 some comments

With the growing focus on functional programming the importance of data design has been thrust to the forefront. That said, you wouldn’t know that the importance was widely agreed upon based on an observation of existing data-driven APIs. Certainly I’ve committed my share of sins in the name of “API data packets,” but with the […]

clojure.spec: Introduction

Jan 10, 2017 some comments

If you’ve looked into the relatively new Clojure library clojure.spec you might have come across something curious. Observe the use of core.spec/or: (require ‘[clojure.spec :as s]) (s/def ::num (s/or :float float? :int int? :ratio ratio?)) (s/conform (s/coll-of ::num) [0.25 1/2 1]) ;;=> [[:float 0.25] [:ratio 1/2] [:int 1]] The result of the call to s/conform […]

Continue