Is there any practical use for the empty type in Common Lisp?
Posted
by
Pedro Rodrigues
on Programmers
See other posts from Programmers
or by Pedro Rodrigues
Published on 2014-07-18T11:28:32Z
Indexed on
2014/08/20
22:33 UTC
Read the original article
Hit count: 406
The Common Lisp spec states that nil
is the name of the empty type, but I've never found any situation in Common Lisp where I felt like the empty type was useful/necessary. Is it there just for completeness sake (and removing it wouldn't cause any harm to anyone)? Or is there really some practical use for the empty type in Common Lisp? If yes, then I would prefer an answer with code example.
For example, in Haskell the empty type can be used when binding foreign data structures, to make sure that no one tries to create values of that type without using the data structure's foreign interface (although in this case, the type is not really empty).
© Programmers or respective owner