University of Virginia, Department of Computer Science
CS200: Computer Science, Spring 2004

Notes: Wednesday 25 February 2004
Schedule

Notes

Mutation Procedures:

(define (map! f lst)
   (if (null? lst) (void)
       (begin
           (set-car! lst (f (car lst)))
           (map! f (cdr lst)))))
Why is mutation scary?




Why is mutation useful?



Why do our substitution evaluation rules fail when we allow mutation?




Would it be possible to create a circular list without using set-cdr!?



cs200-staff@cs.virginia.edu
Using these Materials