[plt-dev] abstract methods

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Fri Apr 23 08:54:59 EDT 2010

Sure but you can't instantiate the class.


On Apr 23, 2010, at 8:47 AM, Robby Findler wrote:

> I was imagining that one would want abstract and non-abstract methods
> in a single class (forcing subclasses to override the abstract ones
> only). Does class/abstract support that?
>
> On Fri, Apr 23, 2010 at 7:42 AM, Matthias Felleisen
> <matthias at ccs.neu.edu> wrote:
>>
>> Actually I don't think so. For that, you'd need to add
>>
>>  class/abstract
>>
>> -- Matthias
>>
>>
>>
>>
>>
>>
>> On Apr 23, 2010, at 8:40 AM, Robby Findler wrote:
>>
>>> Except it should be an error when instantiating the class, not when
>>> calling the method, right?
>>>
>>> Robby
>>>
>>> On Fri, Apr 23, 2010 at 7:34 AM, Matthias Felleisen
>>> <matthias at ccs.neu.edu> wrote:
>>>>
>>>> Everyone adds this syntax rule to OO Racket programs:
>>>>
>>>>> (define-syntax-rule
>>>>>  (define/abstract (x y ...))
>>>>>  (define/public (x y ...) (error 'x "abstract method needs to be
>>>>> instantiated")))
>>>>
>>>> Could some kind current maintainer of class.ss add this rule and  
>>>> add the
>>>> proper syntax magic?
>>>>
>>>> Thanks -- Matthias
>>>>
>>>> _________________________________________________
>>>>  For list-related administrative tasks:
>>>>  http://list.cs.brown.edu/mailman/listinfo/plt-dev
>>>>
>>
>>



Posted on the dev mailing list.