[plt-scheme] is dynamic-require or namespace used here?

From: David Van Horn (dvanhorn at cs.uvm.edu)
Date: Wed Sep 3 21:14:55 EDT 2003

Ryan Jarvis wrote:
> The explanation behind all of this is say I have a lib RealLib and I want
> to write my own version of the library with my own code, MyLib, but I want
> to keep all the procedure names the same.  In order to test if my library
> works, I would write a test program, write universal procedure calls and
> then dynamically call which library I want the procedures to load from
> *without changing the code in the test program* In other words, I can
> debug my library by first running the test program with the real library
> and then running it with my library to compare the output and I can do
> this without altering the code of the test program.

Another approach to this is to create two folders, say:

   /local/mylib/collects/lib/
   /local/reallib/collects/lib/

Both implementations of the library could be named lib.ss and the test code
would use (require (lib "lib.ss" "lib")).

Then set PLTCOLLECTS to /local/mylib/collects/: or /local/reallib/collects/:
depending on which library you want to test (the ":" is needed if you want to
use libraries in the default collection paths as well).

HTH

-d




Posted on the users mailing list.