gnu-smalltalk

Variable types in smalltalk

扶醉桌前 提交于 2019-11-30 09:21:37
问题 I need help understanding the usage and the difference of variables in Smalltalk. What is the difference and the usage of each variable in the given code below? Object subclass: #MyClass instanceVariableNames: 'x' classVariableNames: 'Yy' poolDictionaries: '' category: 'helpMe' MyClass class instanceVariableNames: 'zzz' 回答1: An instance variable ( x ) is a variable that is local to an instance. Neither the class nor any other instance can access that variable. A class variable ( Yy ) is local

Variable types in smalltalk

我的梦境 提交于 2019-11-29 15:06:11
I need help understanding the usage and the difference of variables in Smalltalk. What is the difference and the usage of each variable in the given code below? Object subclass: #MyClass instanceVariableNames: 'x' classVariableNames: 'Yy' poolDictionaries: '' category: 'helpMe' MyClass class instanceVariableNames: 'zzz' An instance variable ( x ) is a variable that is local to an instance. Neither the class nor any other instance can access that variable. A class variable ( Yy ) is local to a class, all its instances, all subclasses and all subinstances (so the entire hierarchy). Any subclass