| Is there a way to get a table containing the current symbol mappings from the surrounding lexical scopes, in a way such that they could be modified or replaced? I was thinking about writing a macro with an "undo" option that could restore the previous local and/or global state before the body was executed. Obviously, if it restored global state, it would require work to make it thread safe. Anyway, I was wondering if anyone had a solution to this thought experiment? |