News for hackers. Stuff that matters.
Re:Thirteen Years of Bad Game Code by saurik on Friday March 31, 2017 @06:26AM (#14002475)
The Emacs property you are demonstrating with let is "dynamic scoping" and not "global variables" (which is leading to a weird and essentially incorrect description, even if it is difficult to notice a behavior difference between that mental model and what really happens).
Re:Thirteen Years of Bad Game Code by sillysaurus3 on Friday March 31, 2017 @06:48AM (#14002557)
A global variable is a variable with global scope, meaning that it is visible and accessible throughout the program, unless shadowed.

Emacs added lexical scoping several years ago. When a global variable is declared in emacs using defvar, in addition to becoming globally accessible, the symbol is also flagged as special. This causes it to use dynamic binding whenever it is `let`-bound, even if lexical scoping is in effect.

I pointed out dynamic binding in order to call attention to a technique that allows global variables to be composed into large-scale systems without being hindered by the problems traditionally associated with global state. But if you'd like more precision, feel free to ask.