11. Types
Common Lisp is a dynamically and strongly typed language. This means that variables do not have a fixed type, but data types are strictly respected during execution.
Some of the most common data types in Common Lisp are:
- Numbers:
integer,float,rational,complex, andnumber. - Text strings:
characterandstring. - Symbols:
symbol,keyword, andnull. - Lists:
list,cons, andnil. - Sequences:
sequence,vector, andarray. - Hash tables:
hash-table,structure-object, andstandard-object. - Functions:
function,compiled-function, andgeneric-function. - Special:
t(true),nil(false or empty list), andboolean.
There are more types, but these are the ones most commonly used.
To check the type of a value, you can use predicates such as typep:
* (typep 42 'integer)
T
* (typep 3.14 'float)
T
* (typep "Hola" 'string)
T
* (typep '(a b c) 'list)
T
This work is under a Attribution-NonCommercial-NoDerivatives 4.0 International license.
Building SPAs with Django and HTML Over the Wire: Learn to build real-time single page applications with Python
The HTML over WebSockets approach simplifies single-page application (SPA) development and lets you bypass learning a JavaScript rendering framework such as React, Vue, or Angular, moving the logic to Python. This web application development book provides you with all the Django tools you need to simplify your developments with real-time results.
Buy the bookHelp me keep writing
Every coffee gives me a push toward the next article.
Sure, it's on me!
Comments
There are no comments yet.