<b>(a)</b> (swap x y) <b>(b)</b> (let ((tmp<sub>1</sub> x)) (set! y x) (set! x tmp<sub>1</sub>)) <b>(c)</b> (swap tmp other) <b>(d)</b> (let ((tmp<sub>1</sub> tmp)) (set! other tmp) (set! tmp tmp<sub>1</sub>)) <b>(e)</b> (define (f x) (define-syntax swap-with-arg (syntax-rules () ((swap-with-arg y) (swap x y)))) (let ((z 12) (x 10)) ; Swaps z with original x: (swap-with-arg z))) <b>(f) </b> (define (f x) (let ((z 12) (x<sup>1</sup> 10)) (swap x z)))
Example 3: Expanding swap.