PREV UP NEXT GNU Emacs Lisp Reference Manual

5.6: Modifying Existing List Structure

You can modify the car and cdr contents of a cons cell with the primitives setcar and setcdr.

Common Lisp note: Common Lisp uses functions rplaca and rplacd to alter list structure; they change structure the same way as setcar and setcdr, but the Common Lisp functions return the cons cell while setcar and setcdr return the new car or cdr.
  • Setcar Replacing an element in a list.
  • Setcdr Replacing part of the list backbone. This can be used to remove or add elements.
  • Rearrangement Reordering the elements in a list; combining lists.