[Grace-core] Annotations

Michael Homer mwh at ecs.vuw.ac.nz
Mon Jun 10 23:36:29 PDT 2013


On Tue, Jun 11, 2013 at 5:52 PM, Kim Bruce <kim at cs.pomona.edu> wrote:
> Ah, I knew the spec was out of date on annotations, so didn't check.  If we do indeed have private then I am fine with having that be the default and then public readable is not redundant.  With no private, it is a bit weird to require public and readable as the (implicit) methods are only useful (as readable only) if you know you are eventually going to be overriding them.  That's a tough distinction to sell to novices.
I don't see why you would need to override them for them to be useful.
> Assuming we do have private, I have found circumstances where I want the implicit readers and writers to have different visibility.  Thus to make things more ambiguous, I would suggest writing public to modify readable and writable.  Thus
>       def x  is public readable, public writable = 2
> means both are public, while
>      def x is public readable,writable = 2
> means only the getter is public (though that looks ambiguous).  Is there a better notation (or set of defaults).
This is currently a syntax error and you will need a conceptual
reworking of annotations to permit it.
>> Surprising as it may seem, this  in the spec!  See §8.7
>>
>> — "is readable" and "is writeable" create confidential reader or writer methods for the annotated variable.
>> So nanograce follows the spec, and minigrace does not.
You all decided to change this following the exact argument you then
describe, but never updated the spec. When you've decided what you
want send me a patch.
-Michael


More information about the Grace-core mailing list