© Vsevolod Domkin 2021
V. DomkinProgramming Algorithms in Lisphttps://doi.org/10.1007/978-1-4842-6428-7_5

5. Arrays

Vsevolod Domkin1  
(1)
Kyiv, Ukraine
 
../images/502489_1_En_5_Chapter/502489_1_En_5_Figa_HTML.png
Arrays are, alongside structs, the most basic data structure and, at the same time, the default choice for implementing algorithms. A one-dimensional array that is also called a “vector” is a contiguous structure consisting of the elements of the same type. One of the ways to create such arrays, in Lisp, is this:
CL-USER> (make-array 3)
#(0 0 0)
The printed result is the literal array representation. It happens that the array is shown to hold 0s, but that’s implementation-dependent. Additional specifics ...

Get Programming Algorithms in Lisp: Writing Efficient Programs with Examples in ANSI Common Lisp now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.