2.75 Exercise 2.75
We can write make-from-mag-ang in the new message-passing style like this:
(define (make-from-mag-ang r a) (define (dispatch op) (cond ((eq? op 'real-part) (* r (cos a))) ((eq? op 'imag-part) (* r (sin a))) ((eq? op 'magnitude) r) ((eq? op 'angle) a) (else (error "Unknown op -- MAKE-FROM-MAG-ANG" op)))) dispatch)
Just like the new make-from-real-imag, this relies on using the magnitude and angle arguments directly from the outer scope, rather than accessing them through functions.