[Grace-core] Abstract methods/classes

Michael Homer mwh at ecs.vuw.ac.nz
Wed Jun 4 17:49:14 PDT 2014


On Wed, Jun 4, 2014 at 10:15 PM, Timothy Jones <tim at ecs.vuw.ac.nz> wrote:
> On 04/06, James Noble wrote:
>> On 4/06/2014, at 13:34 pm, Kim Bruce <kim at cs.pomona.edu> wrote:
>>
>> > We still need to figure out abstract methods.
>>
>> but I found an old Nov 2013 email saying we'd agreed on
>>
>> method foo {abstract}
>>
>> and minutes from Feb 2014 saying the same thing.
>> This is basically Smalltalk's "subclassResponsibilty" message. Running it raises an error.
>>
>> There's an earlier email of mine proposing
>>
>> method foo is abstract {}
>>
>> using an annotation allows a class to be abstract while still having some concrete features
>> but there may be issues having the same annotation for both classes and methods
>> or teaching people about annotations before abstract classes.
>>
>> for me I still lean towards an annotation but I'm not sure why.
>> Michael / Tim - any particular preferences?
>
> I'm leaning back to the annotation approach, where it just bans you from calling
> it directly, but allows you to call it through super or inherit from it. That
> way it works for both methods and class methods.
I don't know what this means either.

The advantage of abstract in the body is that it works within the
existing semantics of the language, rather than being a special case.
I suspect the claimed advantage of an annotation is that it works
outside the existing semantics of the language and is a special case,
however, so take your pick of those.
-Michael


More information about the Grace-core mailing list