[Grace-core] Fwd: Some notes on pattern matching on the wiki

Kim Bruce kim at cs.pomona.edu
Sun Jul 10 16:28:06 PDT 2011


How does this work in practice?  Is it private only if there is no method with the same name?  I thought all accesses of instant variables (private or not) were to be through the methods?

It seems like keywords would be necessary.  What am I missing?

Kim



On Jul 7, 2011, at 7:35 PM, Andrew P. Black wrote:

> 
> 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
> 
> _______________________________________________
> Grace-core mailing list
> Grace-core at cecs.pdx.edu
> https://mailhost.cecs.pdx.edu/mailman/listinfo/grace-core



More information about the Grace-core mailing list