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: ;; Changes one to original value of three ;; Change two to original value of one ;; Change three to original value of two ; ;; Example: ;; if one is 1, two is 2, three is 3, after the function has been called, one is 3, two is 1, and three is 2. ;; if one is 'a, two is 'b, three is 'c, after the function has been called, one is 'c, two is 'a and hree is 'b. ; (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