Exhaustiveness checking in Common Lisp, part 3: etypecase-of

Let’s start with a simplified definition for etypecase-of (assuming type= from Part I). This looks very similar to ecase-of: In fact ecase-of is, conceptually, a special case of etypecase-of. You could define ecase-of in terms of etypecase-of: Although this would probably compile to less efficient code. How can you use this? Here’s a simple example …

Exhaustiveness checking in Common Lisp, part 2: The Case of the Missing ADTs

The term exhaustiveness checking comes from functional languages, and programmers experienced with functional languages may feel confused — where are the algebraic data types? In, say, Ocaml, to get exhaustiveness checking, you first have to define an ADT: This superficially resembles the deftype form above, but what it does is very different. The Ocaml defines …

Exhaustiveness checking in Common Lisp, part 1: ecase-of

A frequently heard wish is that Common Lisp had better support for static types. I am skeptical. I like the idea, but Lispers are far from pushing the boundaries of what the type system of Common Lisp already offers. What does the type system of Common Lisp offer that Lispers don’t use? For me, the …