Bob Rogers wrote:
From re-reviewing our earlier correspondence, I get the impression that you have a particular implementation in mind, one which doesn't seem to work for my use case. Perhaps you should describe the use case for your implementation, and then we can decide whether to combine them.
I have an implementation in mind for dynamically scoped variables in general. It's similar to the implementation of lexicals (may even use the same LexPad structures), but instead of linking along the chain of lexical scopes outward, it links along the chain of return continuations backward. This would allow for capture by return continuations, and so restoration on return invocation. It would also allow for declaring a dynamic variable in one scope that masks-without-modifying a variable in a previous dynamic scope (much like inner lexicals).
I'm just trying to get a clear definition of the problem you're solving, so I can lay solution and problem side-by-side and see if they match. It may be that I need to just spec and implement dynamically scoped variables, then let you try using it and see if you need anything more.
Allison