Chapter 2, Building Abstractions with Data

Section - 2.5 - Systems with Generic Operations

Exercise 2.83


1
2
3
4
5
6
7
8
9
10
11
(define (raise n)
  (apply-generic 'raise n)
)

; Now every package will install raise procedure For eg:
(define (install-scheme-number-package)
   (put 'raise '(scheme-number)
       (lambda (x) (make-rational x 1)) ; using primitive expt
   )
  'done
)