Re:Dynamic Scoping in C++
by masklinn on Monday September 21, 2020 @01:36PM
(#24546174)
Incidentally that makes it super easy to mock out or intercept subsystems if they use dynamically scoped hooks e.g. in most languages intercepting stdio is a pain in the ass (you might have to swap out multiple globals, it's not thread-safe, etc…).
If you're in CL however, you can just rebind standard-output and you'll capture what anyone downstack sends there.
If you're in CL however, you can just rebind standard-output and you'll capture what anyone downstack sends there.