ToC DocOverview CGDoc RelNotes Index PermutedIndex
Allegro CL
Home Previous Up Next Table of Contents Index
  ANSI Common Lisp   14 Conses   14.2 Dictionary of Conses

14.2.8 rplaca, rplacd Function

Syntax:
rplaca cons object cons
rplacd cons object cons

Pronunciation:
rplaca: [ 'rê'plakE ] or [ 'rE'plakE ]

rplacd: [ 'rê'plakdE ] or [ 'rE'plakdE ] or [ 'rê'plakdê ] or [ 'rE'plakdê ]

Arguments and Values:
cons - a cons.

object - an object.

Description:
rplaca replaces the car of the cons with object.

rplacd replaces the cdr of the cons with object.

Examples:
 (defparameter *some-list* (list* 'one 'two 'three 'four))  *some-list*
 *some-list*  (ONE TWO THREE . FOUR)
 (rplaca *some-list* 'uno)  (UNO TWO THREE . FOUR)
 *some-list*  (UNO TWO THREE . FOUR)
 (rplacd (last *some-list*) (list 'IV))  (THREE IV)
 *some-list*  (UNO TWO THREE IV)

Side Effects:
The cons is modified.

Should signal an error of type type-error if cons is not a cons.

Allegro CL Implementation Details:
None.

Home Previous Up Next Table of Contents Index
© Franz Inc. 1998-2017 - File last updated 01-11-2017