The BASIC language did not have the notion of variable scopes. All variables were statically allocated and globally accessible.


In C, if a variable has "static" in front of it, it is private to the code module. If someone decides to stick it in a header file, then every source file that #includes that header file will have their own private copy.


The general principle of what you're doing would seem to be correct. I would add, though, that unless you're doing anything outside the interrupts except spinning, you would need to save and restore processor registers to ensure the interrupt handlers to not mess with that code. In fact, that part, outside the interrupt handlers, is what you'd typically ...


(I guess this isn't really retrocomputing, and more general programming languages theory ...) "Private" in OOP is tied to a particular object, and non-OOP languages usually don't have objects. If you allow other constructs: Module systems in nearly all languages have a concept of "exported" vs. "non-exported" ("private"...


Haskell (from 1990) does this as well: doubleMe x = x + x defines a function doubleMe of one parameter x and assigns the function body x+x to it, see the great Learn You A Haskell For Great Good

Only top voted, non community-wiki answers of a minimum length are eligible