0:00 / 0:00
#clojure#clojure.spec#generativetesting
Introduction to clojure.spec - Arne Brasseur
Metosin
9K subscribers • 22 videos on Hallway
- Recommended by 2 people: 2 in engineering communities.
- Presented by Arne Brasseur
Beginner. No background in the topic needed.
3.9K views10 years ago2 recommendations
Programming languagesTools and practiceLisp and ClojureTesting
Arne Brasseur introduces clojure.spec, demonstrating how to write specs, instrument functions, parse data, and perform generative testing.
The latest big announcement from Cognitect is clojure.spec. It comes with a promise of better runtime checking, improved error messages, and a shared vocabulary for communicating the structure of data. In this hands-on talk I'll start with the basics, then work up to more complex examples. I'll show you how to write specs, and how to use them to instrument functions, parse data, and do generative testing. Slides: arnebrasseur.net/talks/2016-clojutre/Why it's here
2 people recommend thisWhat people say. Recommended as a great hands-on introduction to clojure.spec and its data parsing capabilities.
u/Azel4231in r/Clojure • Recommends
On “Are the results from conform in the spec library ever used in implementation for anything other than verification”
Conforming is parsing. This can be a string parser like Borkdudes example and this one: http://thegeez.net/2016/12/09/parsing_clojure_spec_advent_of_code.html
But spec's conform can also "parse" data structures. This enables detecting patterns in arbitrary data, like https://feierabendprojekte.wordpress.com/2016/09/11/generating-ui-for-arbitrarily-nested-data-structures/
Conformance is destructuring, and combined with multimethods it is more like "pattern matching on steroids": link to this video
Edit: fixed last sentence