Destructive Operations on Lists

There are functions that destructively change the contents of pairs (lists).

(set-car! pair value)
(set-cdr! pair value)


> (define lst '(a b c))
lst

> lst (a b c)

> (set-car! lst 'e) (e b c)

> (set-cdr! (cdr lst) '(or not e b)) (b or not e b)

> lst (e b or not e b)

Contents    Page-10    Prev    Next    Page+10    Index