CS 136 Tutorials - Spring 2007

CS 136 Home » Tutorials » Tutorial 2: Service Managers and Destructive Methods »

Solution for second semantics example

The part of the code marked in green is the part which is about to be expanded, and the part marked in red is the part which was just expanded.

Previous First Next
(define unique1* (cons 'c unique4*))
(define unique2* (cons 'b unique1*))
(define lst-1 unique6*)
(define unique3* (cons 'a unique1*))
(define lst-2 unique3*)
(define unique4* (cons 'd empty))
(define unique5* (cons 'd empty))
(define unique6* (cons 'a unique5*))
(set-rest! unique3* (rest unique1*))
(set-rest! lst-1 empty)