Screencasts and courses for web developers

New videos every month on React, ClojureScript & JavaScript

Episode #1

Parsing with clojure.spec

In this episode we take a look at how clojure.spec can be used to parse Clojure’s data-driven DSLs in a way that makes it straightforward to define the syntax and compile embedded languages such as Hiccup.

(require '[clojure.spec.alpha :as s])

(s/def :geo/point
  (s/cat
    :x number?
    :y number?))
  
(s/conform :geo/point [8 -3])
;; {:x 8, :y -3}

Code from this episode: 89579cdf17c59da516e6f850d25d2ea1

Support us

Did you like the content and want to see more? These videos are created by a single developer in his spare time. You can support the effort by becoming a patron at Patreon.