This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: void) ; ;; Effects: ;; Changes one to original value of three ;; Change two to original value of one ;; Change three to original value of two ; ;; Example: after the function has been called, one will contain the initial value of three, two will contain the initial value of one, and three will contain the initial value of two. ; (define (shift) (local [(define x one)] (begin (set! one three) (set! three two) (set! two x)))) ;; Tests: (checkexpect (begin (set! one 'a) (set! three 'b) (shift) (equal? one 'b)) true) (checkexpect (begin (set! two 'a) (set! one 'b) (shift) (equal? two 'b)) true) (checkexpect (begin (set! three 'a) (set! two 'b) (shift) (equal? three 'b)) true)...
View Full
Document
 Fall '09
 T.VASIGA
 Computer Science

Click to edit the document details