Re:History of T
by kragen on Saturday July 15, 2023 @01:28AM
(#36733863)
i don't think dynamic scoping saves you space; with either dynamic scoping or lexical scoping, each call to a function that binds three variables must allocate space for three values. the only difference from that perspective is that, with dynamic scoping (and shallow binding!), the newly allocated space holds the old values of the variables, while with lexical scoping (or deep binding) it holds the new values
some implementations of dynamic scoping with shallow binding store each of the three values in a separate cons cell, doubling the space cost, but that's not essential to the dynamic/lexical distinction
some implementations of dynamic scoping with shallow binding store each of the three values in a separate cons cell, doubling the space cost, but that's not essential to the dynamic/lexical distinction