Node:Classes and Scoping, Next:Dividing classes, Previous:Method conveniences, Up:Objects
Inheritance is frequent, unlike structure extension. This exacerbates the problem with the field name convention (see Structure Naming Convention): One always has to remember in which class the field was originally defined; changing a part of the class structure would require changes for renaming in otherwise unaffected code.
To solve this problem, I added a scoping mechanism (which was not in my
original charter): A field defined with
inst-value) is visible only in the class where it is defined and in
the descendent classes of this class. Using such fields only makes
m:-defined methods in these classes anyway.
This scoping mechanism allows us to use the unadorned field name, because name clashes with unrelated words become much less likely.
Once we have this mechanism, we can also use it for controlling the
visibility of other words: All words defined after
protected are visible only in the current class and its
public restores the compilation
current) word list that was in effect before. If you
protecteds without an intervening
will restore the compilation word list in effect before the first of