Basically we just iterate the environment and assign all the variables over. This should work for atomic types. Things get a bit trickier if you ever tried to copy over functions or formulas which hold on to the environment where they were created.

Email codedump link for How to &quot;instantiate&quot; an enviroment in the current one?