Open 38a938c2 opened 5 years ago
Maybe an alternative way of stating this is allowing the new augmented environment to have the same dynamic extent as the environment before augmentation.
I am afraid I don't really understand the issues involved, nor why this functionality would be useful.
This is not an addition of functionality, just a separation of what the reference implementation does (everything is done properly) and what a protocol defines as guarantees. (The goal is, obviously, to define a subset which is cheaper to implement on top of implementations making unexpected implementation decisions).
OK, no new functionality, but I still don't see what the purpose would be. Perhaps it is just an optimization issue? And I don't see how the protocol could give any such guarantees about dynamic extent, given that any client code can capture the environment and do what it pleases.
Given that Common Lisp implementations are allowed to provide lexical environments with dynamic extent to macros, would it make sense to (also) provide augmentation macros where new environment has lexical scope and dynamic extent? It would be sufficient in many cases, and might be easier to implement safely in case the environments do indeed have dynamic extent.