3 ms·
Dynamically scoped variables have been around for a long time, and have existed in perl since version 4. I don't know which language first introduced them, but
by webstrand 4y ago
Dynamically scoped variables have been around for a long time, and have existed in perl since version 4. I don't know which language first introduced them, but the Bourne Shell had them (and I suspect perl inherited them, like many other things, from shell). I do wish they were offered in more languages.
- sekia 4y agoAFAIK original LISP is the oldest language with dynamic-scoped variables. Although these were introduced as an implementation bug at first, and modern dialects (Scheme / Common Lisp) eventually replaced them with lexical-scoped variables, dynamic-scoped variables are still supported with different syntax in them (parameter objects in Scheme and special variables in CL.)