[Grace-core] Visibility of variables and constants in Objects

James Noble kjx at ecs.vuw.ac.nz
Wed Jul 3 01:22:12 PDT 2013


On 3 Jul 2013, at 08:25, "Andrew P. Black" <black at cs.pdx.edu> wrote:

> I'm very interested in talking about this more and finding out why the changes that you proposed would help.

I am too - especially while we're all in the same place! 

So here's my line:

I see defs, vars, & methods as offering alternative implementations of requests.
I don't think the resolution of a request should depend on its implementation.
I'd prefer the request evaluation/lookup/environment composition rules, and the access protection rules, and any defaults did not depend on the end implementation of the request.

I think there is a kind of programs (or a pattern/usecase of objects) where it makes sense that all variables (in particular) are protected/confidental, and all methods are public.  
In larger programs (or larger objects?), I'd expect more methods than fields, and there will be auxiliary methods that should be protected. 
In very small programs - really just one-slide examples - you'll want everything public.

James 


More information about the Grace-core mailing list