Adderall’s amphetamine components were not tested by the authors and possible outcomes for it cannot be inferred from their study, due to significant differences in method of action: https://pmc.ncbi.nlm.nih.gov/articles/PMC8063758/
This argues for dynamically scoped variables - bindings that are scoped and inherited by all called functions without having to be passed explicitly. After all, why should everyone in the call chain need to know if some deep call allocates temporary storage.
It's always bothered me that the only such feature in many languages is exception handlers (I'm also bothereed by functions that throw things).
I want "late" bindings, implemented as "shallow" bindings. "Late" as in binding is established at runtime in the call chain. "Shallow" as in you don't need to crawl the call chain to find it. Something like
yeah once you get used to reaching for dynamic scoping for thorny crosscutting concerns it's really rough when you don't have it. clojure/raku ruined me in that regard; some things simply don't need to get plumbed through every intervening layer explicitly.
i have some generic command dispatch stuff that handles sudo/doas or other similar cli prefix wrapper utilities by just passing that info all the way down to the eventual external proc invocation as a dynamic variable (and actually it wouldn't even let me get away with sticking it all into the signatures because of potential argument conflicts in the general case). that way everything external this tool dispatches to can be defined as if run unprivileged for concision/flexibility but you still never need to invoke the tool itself with root privileges to sneak a sudo in for the eventual command because there's a mechanism for indicating desired privilege escalation that can quietly ripple out to everywhere it's needed without cluttering already complex signatures even more.
personally i find dynamic scoping immensely useful specifically in conjunction with exception handling: it can help you turn resumable exceptions into exceptions that return values to the thrown context in just a couple lines for e.g. an incredibly lightweight effect handling implementation or whatever you wanna do with that.
that said, without something readily visually distinguishing like raku's explicit twigils indicating a dynamic variable or something like clojure's conventional earmuffs on names to indicate the same, i do get why it's often seen as more trouble than it's worth by those less used to it.
"Among economic scholars, Friedman has no peer. His seminal contributions to economics are legion, including his development of the permanent-income theory of consumer spending, his paradigm-shifting research in monetary economics, and his stimulating and original essays on economic history and methodology.
...
Let me end my talk by abusing slightly my status as an official representative of the Federal Reserve. I would like to say to Milton and Anna: Regarding the Great Depression. You're right, we did it. We're very sorry. But thanks to you, we won't do it again." -Ben Bernanke
reply