Home Segments Index Top Previous Next

176: Mainline

The scope of a variable is that portion of a program in which that variable can be evaluated or changed. The local variables in Smalltalk are locally scoped: those variables are available for evaluation or assignment in only the method itself.

  • A variable value assigned in one method cannot interfere with a variable assignment or parameter assignment in another method, even if the names are the same.
  • The value of a variable established in one method cannot be determined in another method.