Background
I am using the scheme chicken implementation. Latest version (4.9.0.1).
I am trying to implement a generic arithmetic system on rational, complex and fix-precision numbers in a file called arithmetic.scm
.
But for the complex numbers, as I also designed a generic arithmetic system for both rectangular and polar representations, I decide to write the code for the complex number in file called complex.scm
.
Problem
So when I try to load the complex.scm
into the file arithmetic.scm
, I found that some functions have the same name in both files, so I want to use a lambda to wrap the former into a sub environment and register the operators from there using property list. However, the load
command can only load the script into the global environment no matter where it is writen. I wonder, other than renaming the functions or copy all the code from complex.scm
into a lambda function, what other options do I have. Thanks a lot!