3 ms·
> They will if they're all methods of the class (as I said: "along with their callees"). And arguably, all the functions that care about these variables should
by zeveb 8y ago
> They will if they're all methods of the class (as I said: "along with their callees"). And arguably, all the functions that care about these variables should be methods of a single class.
I don't think so: the entire point is that functions in different libraries, written by different programmers, care about the same things — and this isn't a bad thing. E.g., if the user wants to customise his output language, then he wants to set it once; he doesn't want to have to set library.language for a dozen different libraries. And if for some reason he wants to generate a small piece of output in another language within one dynamic context, then he wants to set it only for that context, not just set it across all dynamic contexts (e.g. my menus should still display in English even if I'm running some stuff in Italian).
The difference in mindset between us, I think, is that maybe you think that a system is written by one person who can architect it such that he knows all the change points ahead of time; I'm thinking of large systems written by hundreds of people, in which that's just not possible. E.g. emacs or GNOME — heck, modern Microsoft Office would meet that definition.
Your example sounds like a weird pre-Common-Lisp thing. Nowadays that only way READ would read NIL as something different from COMMON-LISP:NIL would be if the current package didn't use COMMON-LISP — and surely that would be what one meant, if one did that (e.g. maybe one wanted to build a sandbox environment or something).
> But somebody overlooked the current package as being one of them. If the reader had been an object one had to instantiate before calling, the bug would probably never have arisen (I expect there would have been a function STANDARD-READER, or some such, that one could call to get a reader instance with standard options).
Such as WITH-STANDARD-IO-SYNTAX, perhaps? It does exactly what you're looking for.