John is correct that do() is not imperative assignment. It’s a different effect called “lazy dynamic scope.”
do() is described fully in our paper on formal semantics for a language with counterfactuals, http://www.jameskoppel.com/files/papers/causal_neurips2019.pdf . The connection with dynamic scope is covered in the appendix, which is not yet online.
John is correct that do() is not imperative assignment. It’s a different effect called “lazy dynamic scope.”
do() is described fully in our paper on formal semantics for a language with counterfactuals, http://www.jameskoppel.com/files/papers/causal_neurips2019.pdf . The connection with dynamic scope is covered in the appendix, which is not yet online.