O'Reilly logo

Common Lisp Recipes: A Problem-Solution Approach by Edmund Weitz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5. Arrays and Vectors

In theory, everything that can be done with arrays can also be done with lists. But just because lists are the ubiquitous data type in Lisp and Lisp is an abbreviation for “LISt Processing,” you shouldn’t be tempted to use lists exclusively. Lists are extremely flexible and lend themselves incredibly well for prototyping (see Chapter 2), but for many algorithms arrays are the better choice because of their constant-time access characteristics.

Arrays in COMMON LISP have many facets and can be used like arrays in C or JAVA (which are essentially structured, fixed-size memory blocks), but also like arrays in PERL or RUBY (where in a way they behave like lists with array access characteristics). That’s what this section is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required