University of Washington • CSE583 • D. Notkin © 2000
33
Side-effects
lThere are several special forms that allow side-effects (note the ! convention)
–set! set-car! set-cdr!
lset! rebinds a variable to a new value
l(define (test x)
  (set! x (cons 1 x))
  x)
(test ‘(2 3)) ® (1 2 3)