I recently started fiddling with type specifiers to improve code efficiency. This is a list of all the type specifier symbols in the Common Lisp standard.
I can't see the tree through the forest.
Could anyone give (or point to) a short description of the different type specifiers, and when one would use them?
Though I'm interested to learn about all of them, my direct interest goes out to the differences between number related types (fixnum, bignum, float, single-float, short-float, etc...)
Common Lisp has a complete and flexible type system and corresponding tools to inspect, check and manipulate types. It allows creating custom types, adding type declarations to variables and functions and thus to get compile-time warnings and errors.
Type specifiers indicate the type of the object being declared. See the following available kinds of types: Fundamental or built-in types: Arithmetic types.
In Common Lisp, a data type is a (possibly infinite) set of Lisp objects. Many Lisp objects belong to more than one such set, and so it doesn't always make sense to ask what is the type of an object; instead, one usually asks only whether an object belongs to a given type.
1. Numbers: Numbers are used for storing the integer and floating-point values. Numbers are represented by the symbol number. Lisp has two types of numbers: integer and floating-point.
CLtl2 describes a version of Common Lisp before it was standardized. Don't use it as a reference, there are various differences to the standard.
Use the Common Lisp Hyperspec, which is based on the ANSI Common Lisp Standard.
The types of Common Lisp are described in the HyperSpec here: 4.2.3 Type Specifiers. The various types are linked from there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With