soegaard / racket-cas

Simple computer algebra system
60 stars 10 forks source link

Refactor and PR 11 (integrate) #19

Closed soegaard closed 4 years ago

soegaard commented 4 years ago

This pull request refactors racket-cas into a set of smaller modules. The main reason for splitting up racket-cas.rkt were to improve compile times.

To make all rkt files use: raco make *rkt

To test all rkt files use: raco test *rkt

When working on a single module, say, integral.rkt it is no much faster to do: raco make integral.rkt raco test integral.rkt To test new changes.

Before the change racket-cas.rkt contained everything. Now it simply require a lot of modules and reprovides the bindings.

The core is meant to be small. I may move more stuff from it. Right now the other modules all require "core.rkt" and "math-match.rkt". I am considering make a base module to that contains the core, math-match, and a few of the other modules.

I have reluctantly used dynamic-require a few places to avoid cycles in the module graph. In particular a lot of test modules needs normalize in the tests, but not in their main module.

Since the refactoring made PR 11 (integrate) impossible to merge automatically, I have put most of PR11 in integrate.rkt and tried to incorporate the other changes where appropriate.

Very few tests of integrate.rkt fails due to the refactoring - I hope the remaining ones will be easy to fix. Thanks to Bowen Fu for his work on integrate - there is an impressive amount of expressions that can now be integrated.