News for hackers. Stuff that matters.
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.

Re:Dynamic Scoping in C++ by Jtsummers on Monday September 21, 2020 @02:04PM (#24546485)
Or rebind standard-input and feed an interactive program input from a file or other stream.