-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Mastering Clojure
By :
Type checking is something that is often taken for granted in statically typed languages. With type checking, type errors can be found at compile time, rather than during runtime. In some dynamic languages such as Clojure, type signatures can be declared wherever and whenever they are required, and this technique is termed as optional typing. Type checking can be done using the core.typed library (https://github.com/clojure/core.typed). Using core.typed, the type signature of a var can be checked using type annotations. Type annotations can be declared for any var, which includes values created using a def form, a binding form, or any other construct that creates a var. In this section, we will explore the details of this library.
The following library dependencies are required for the upcoming examples.
[org.clojure/core.typed "0.3.0"]
Also, the following namespaces must be included in your namespace declaration.
(ns my-namespace (:require [clojure.core...