s-expressionists / Trucler

Environment protocol for Common Lisp compilers.
33 stars 3 forks source link

Dynamic extent environment augmentation #10

Open 38a938c2 opened 5 years ago

38a938c2 commented 5 years ago

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.

38a938c2 commented 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.

robert-strandh commented 5 years ago

I am afraid I don't really understand the issues involved, nor why this functionality would be useful.

38a938c2 commented 5 years ago

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).

robert-strandh commented 5 years ago

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.