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

James Noble kjx at ecs.vuw.ac.nz
Fri Jul 8 01:27:08 PDT 2011


> 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.  

sure

> The same will be true in Grace.  So the designer of an object has the choice of whether to make variables private or protected,

well I'm not sure about that. 
That means we'd have lexical scope and "dynamic dispatch scope" inside a single object.
I think AmbientTalk does this, according to Tom - http://soft.vub.ac.be/amop/at/tutorial/multiparadigm

but i was thinking about a simpler model:
there are (nested) lexical scopes that (mostly) are used for library/module mangement.
these are accessed by "implicit" sends.

on the other side, features of the "self" object and objects/classes it extends
are accessed _only_ via the self keyword

(this is a variant of AmbientTalk version, 
or Gilad's DYLA07 option 3 but there is no ambiguity,
no "option" about which form to use)


Hmm: someone aught to type up (briefly) the nested object stuff,
then we can talk about it properly.

>  but without any keywords.

Michael H had a good comment about the various privacy options
(still uncommented) on the blog: 

given that we're going to have extensible metadata annotations,
we may as well use that for privacy & encapsulation
rather than a one-off syntatic design...


>> 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!

yep...

James


PS it seems Tom VC did most of the edits to Wikipedias AmbientTalk page - 
so perhaps we'll have to swallow our pride & do our own page...

J


More information about the Grace-core mailing list