Process local variable and debugging
Lex Spoon
lex at cc.gatech.edu
Mon Feb 11 20:09:38 UTC 2002
>
> One bit of frustration in using process globals is that the methods that
> access them are not always obvious, and when trying to evaluate methods
> that expect certain process globals to be present, it's not always easy
> to know exactly what is expected of the caller (in terms of setting up
> process globals). It would be nice for formalize this a bit.
>
Yes -- this is why most languages use statically bound variables
nowadays: it's nice being able to see which variables are relevant to a
particular method without having to trace the program's control flow.
But, occasionally you still want a variable of very wide scope, and
frequently it makes sense to let your caller define the variable,
instead of leaving it as a single-valued global variable. When you do
so, you'll run into all the same difficulties as before, but it's
reasonable so long as there are very few of the buggers.
-Lex
More information about the Squeak-dev
mailing list
|