3 ms·
Clojure has an optional type system: https://github.com/clojure/core.typed https://github.com/clojure/core.typed (note that Lisp is flexible enough that a type
by tsm 5y ago
Clojure has an optional type system: https://github.com/clojure/core.typed https://github.com/clojure/core.typed
(note that Lisp is flexible enough that a type system can be written as a library)
There's also this for run-time checking (i.e., you won't get any help at compile-time, but functions called with bad values will fail in very clear ways): https://github.com/plumatic/schema https://github.com/plumatic/schema
- jeofken 5y agoHopeful new lispers beware that core.typed is not so easy to use as TypeScript, and slows things down quite a bit, and you will need to write a lot of type definitions for 3rd party code. Most (all I’ve seen) clojure shops instead rely on runtime type checking with Spec or Schema, both still popular