Next: Sets And Lists, Previous: List Variables, Up: Lists
You can modify the car and cdr contents of a cons cell with the
primitives setcar and setcdr. These are destructive
operations because they change existing list structure.
Common Lisp note: Common Lisp uses functionsrplacaandrplacdto alter list structure; they change structure the same way assetcarandsetcdr, but the Common Lisp functions return the cons cell whilesetcarandsetcdrreturn the new car or cdr.