Originally posted by Joro Kolev
View Post
I tend to slightly disagree with 2. The user might have adopted the convention (as suggested in 1) that scalars always start with an underscore. Or, more likely, the user might not be to blame if they have called a command, community-contributed or by StataCorp, that has previously created and relies on (system) variables (or scalars) that start with underscores; psmatch2 (SSC) or mi come to mind. There really is no point in risking overwriting those variables. So, yes, we can do what StataCorp does: do not use "simple", permanent names, such as _i, unless you intend to leave them behind; in that case, ask or at least tell the user. Otherwise, use temporary names for intermediate objects that are not left behind (that is kind of the main idea of tempvar and tempname).
Comment