User Tools


Function RPLACA, RPLACD

Syntax

  • rplaca cons objectcons
  • rplacd cons objectcons

Arguments and values

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.

Affected By

None.

Exceptional situations

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

Example Implementation

To be done.

Notes

None.