理系学生日記

おまえはいつまで学生気分なのか

問題2-73c (2.4.3 Data-Directed Programming and Additivity)

(define (install-exponential)
  (define (deriv-exponential exp var)
    (print exp)
    (make-product (exponent exp)
		  (make-product (deriv (base exp) var)
				(make-exponentiation (base exp)
						     (- (exponent exp) 1)))))
  (put 'deriv '** deriv-exponential)
  'done)