| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You can modify the CAR and CDR contents of a cons cell with the
primitives setcar and setcdr. We call these "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.
5.6.1 Altering List Elements with setcarReplacing an element in a list. 5.6.2 Altering the CDR of a List Replacing part of the list backbone. This can be used to remove or add elements. 5.6.3 Functions that Rearrange Lists Reordering the elements in a list; combining lists.