7. Arithmetic operations

Common Lisp supports basic arithmetic operations such as addition, subtraction, multiplication, and division. Here are some examples:

* (+ 5 3)
8

* (- 10 4)
6

* (* 7 6)
42

* (/ 20 5)
4

* (1- 3)
2

* (1+ 4)
5

If you want to perform operations with more than two numbers, simply add more arguments:

* (+ 1 2 3 4 5)
15

To count the number of elements in a list, you can use the length function:

* (length '(a b c d e))
5
Building SPAs with Django and HTML Over the Wire: Learn to build real-time single page applications with Python

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 book

Help me keep writing

Every coffee gives me a push toward the next article.

Comments

There are no comments yet.