[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

embedded mzscheme and initializing the mzscheme environment as well as my own



I am embedding mzscheme into a C++ application (and library) that uses the
Singleton design pattern and the Object Lifetime Manager (or whatever it's
called) design pattern to ensure that my application components follows the
correct elaboration order, etc.

As part of the elaboration of my MLT_Enivornment component, I create the
mzscheme environment and then add symbols and create mzscheme types in the
mzscheme environment.  Since this Singleton is declared as a static object,
it is elaborated prior to main.  I am wondering if it is improper to create
the mzscheme environment prior to entering main.  Should I expect different
behavior on different compilers and OSs?  Obviously, I can move
initialization around a bit and my application will keep running, however, I
would really like to move all of my systems startup and initialization calls
into their respective modules and allow for a cleaner main routine.  Doing
so will make it easier for other folks to extend the application, control
their own elaboration code, and ensure that the right thing always happens
from an elaboration perspective.  My approach works fine on my current
platform.

Thoughts?


cheers,
gregory