[Grace-core] Fwd: Some notes on pattern matching on the wiki
Andrew P. Black
black at cs.pdx.edu
Thu Jul 7 19:35:09 PDT 2011
On 7 Jul 2011, at 16:16 , James Noble wrote:
> Right. I just realised this myself this morning:
> this will be no worse than Smalltalk code that uses accessor methods for all variable accessses
> (which I think was once considered good Smalltalk style and hopefully still is?)
Yes, that's right. In Smalltalk, if you use direct variable access, you will always access the variable; there is nothing a subclass can do to change the meaning of that code. Conversely, if you use an accessor, tenth subclass can override it. The same will be true in Grace. So the designer of an object has the choice of whether to make variables private or protected, but without any keywords.
> I'm not sure what you mean by super & sub object here?
> (in smalltalk terminology - the a subclass method to access a superclass field?)
Yes, exactly. Except that in Grace there may be no classes. if a extends b, then b is a super object of a, and a is a sub-object of b. Better terminology needed!
Andrew
More information about the Grace-core
mailing list