a generic arithmetic system implemented using one of SiCP lessons, namely data directed programming.
- implement a
radical
package; - implement a
matrix
package; - implement a
fraction
package; - implement a
polynomial
package; - implement a
rational-function
package; - implement an
integer
package; - implement a generic
print
procedure; - define the procedures in the
polynomial
package to operate on abstract data, ie., data abstraction; and - define the procedures in the
matrix
package to operate on abstract data, ie., data abstraction.
- Emacs and MIT Scheme.
Data directed programming is a technique for increasing modularity of your system; by dividing the system into packages multiple individuals can work on the system at the same time.
First, you have to to install Emacs
and MIT Scheme
; if you haven't already, you can install these using homebrew
, the package manager for macOS.
Then, you load the file generic-arithmetic.scm
.
You can look at the tests to get an idea of how data is represented and to try out more examples.