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

Andrew P. Black black at cs.pdx.edu
Wed Jul 3 02:21:41 PDT 2013


On 3 Jul 2013, at 01:30 , Michael Homer wrote:

> Access to the same thing follows two different rules depending on how
> you annotated it.

I think that this nicely captures the difference in viewpoint.  Michael (and James, I think) view defs and vars in objects as being fundamentally different from defs and vars elsewhere in the language: like methods, such defs and vars are "features" of the object, and all "features" should be accessed uniformly.

Kim and I view defs and vars in objects to be just like defs and vars in other places.  The annotation on them generate methods, and those generated methods are treated like other methods.

As to the defaults for these generated methods being different from the defaults for explicit methods, Michael is right: we can't remember what the rules are, and nor will the students.  That's why I've started writing is publiclyReadable, is confidential, is confidentiallyReadable, etc, so that the annotations are explicit and clear, and there is nothing to memorize.

If we were to agree on a language change for def and var access in objects, so that they are bound like methods rather than like other defs and vars, then we should also change the keywords. 

	Andrew

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailhost.cecs.pdx.edu/pipermail/grace-core/attachments/20130703/05d8deb6/attachment-0001.html>


More information about the Grace-core mailing list