[Grace-core] Abstract methods/classes

James Noble kjx at ecs.vuw.ac.nz
Wed Jun 4 01:11:46 PDT 2014


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? 

James



Begin forwarded message:

> From: James Noble <kjx at ecs.vuw.ac.nz>
> Subject: [Grace-core] belated Minutes of Telecon 27-28.02.2014
> Date: 27 March 2014 8:59:31 am GMT+12
> To: "grace-core at cecs.pdx.edu" <grace-core at cecs.pdx.edu>
> 
> more belated collated minutes:

> - abstract methods .... write method foo {abstract} 


Begin forwarded message:

> From: Kim Bruce <kim at cs.pomona.edu>
> Subject: Re: Are we meeting tomorrow?
> Date: 5 November 2013 2:16:47 pm GMT+12
> To: James Noble <kjx at ecs.vuw.ac.nz>
> Cc: "Andrew P. Black" <apblack at ownmail.net>, Michael Homer <Michael.Homer at ecs.vuw.ac.nz>, Timothy Jones <tim at zimothy.com>
> 
> So we are planning on meeting tomorrow from 1 to 3 p.m. PST.  I gather you are off by 3 hours currently with all the shifts in daylight time.  Does that still work for you?
> 
> We did make some progress.
> 
> We decided that abstract methods could be represented by having methods with a body that consists of the word abstract.  If executed it would cause the execution to throw an exception.  A nice thing about using this as the keyword for abstract methods is that it is easy to check statically by a pluggable checker.  I.e., don't construct an object/class if there are any abstract methods.  (I think everything is static enough that we can check that -- superclasses must be statically known.)  We will need to have the type of abstract (and exceptions raised) as bottom to make the type-checking work.
> 
> We worked something else out, but my brain has gone to jelly.  Hopefully someone else can document that (or I'll remember after a few hours).
> 
> Kim
> 
> 
> 
> On Nov 4, 2013, at 6:08 PM, James Noble <kjx at ecs.vuw.ac.nz> wrote:
> 
>> no-on else replied, so I presume this didn't happen…?
>> 
>> how're you're discussions going?
>> 
>> J
>> On 5/11/2013, at 8:27 AM, James Noble <kjx at ecs.vuw.ac.nz> wrote:
>> 
>>>> I'm available 13:00 -- 15:00 Pacific STANDARD time tomorrow is toy want to meet.  Do you?
>>> 
>>> yes we should. I've lost track of when Michael & Tim are meeting you today
>>> (and tomorrow morning??) 
>>> 
>>> J
>> 
> 
> 





Begin forwarded message:

> From: James Noble <kjx at ecs.vuw.ac.nz>
> Subject: Fwd: Repost: [Grace-core] [less important] Abstract methods and classes & Annotations
> Date: 25 February 2014 3:36:52 pm GMT+12
> To: James Noble <kjx at ecs.vuw.ac.nz>
> 
> 
> 
> Begin forwarded message:
> 
>> Older message about Abstract done with annotations
>> 
>> Begin forwarded message:
>> 
>>> From: James Noble <kjx at ecs.vuw.ac.nz>
>>> Subject: [Grace-core] [less important] Abstract methods and classes & Annotations
>>> Date: 9 March 2013 8:08:09 PM NZDT
>>> To: Kim Bruce <kim at cs.pomona.edu>, "Andrew P. Black" <black at cs.pdx.edu>, Timothy.Jones at ecs.vuw.ac.nz
>>> Cc: grace-core at cecs.pdx.edu
>> 
>> We should add an "abstract" annotation.  
>> 
>> A method that "is abstract" throws a dynamic error if called.
>> (option: it should also have an empty body, note that we 
>>  can't really get rid of the body altogether...)
>> 
>> An object constructor / class that "is abstract" throws a dynamic
>> error if called **as a normal message request**, but not as a
>> **factory message request**.
>> 
>> Optionally, could throw errors or warnings if you define a class or
>> object constructor with an abstract method that is not itself
>> abstract.
>> 
>> The standard static checker should raise static warnings about
>> abstract.
> 
> 





More information about the Grace-core mailing list