What types of languages allow programmatic creation of variable names?
问题 This question comes purely out of intellectual curiosity. Having browsed the Python section relatively often, I've seen a number of questions similar to this, where someone is asking for a programmatic way to define global variables. Some of them are aware of the pitfalls of exec , others aren't. However, I've recently been programming in Stata, where the following is common: local N = 100 local i = 1 foreach x of varlist x1 - x`N' { local `x' = `i' * `i' ++i } In Stata parlance, a local