~/talk

Above and beyond type systems with clojure.spec

Talkat Codemotion Milan 2017 · 2017-11-10..11-11· [testing]
slides:none on file

Clojure 1.9’s clojure.spec lets code express runtime constraints, not compile time types, and attaches specs to functions so wrong inputs raise exceptions instead of silently returning nil. The demo shows a hello-user function, using instrument to enable checks, a custom non-blank-string predicate, a multi-spec dispatch for authenticate that validates two different return shapes based on authenticated true/false, and generators that produce valid JWT tokens for generative testing. Specs run in production for boundary checks and give explainable failure messages.

AI-written summary · about

  1. 0:00Start
  2. 2:59clojure.spec?
  3. 3:39What spec is...
  4. 6:05A Clojure primer
  5. 8:32We start with a predicate
  6. 9:19Attach the spec to a function
  7. 18:26Function spec at its finest
  8. 20:09Greeting a JWT-authenticated user
  9. 32:57Philosophy and philology of
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.