[racket] public, override -- how to combine

From: Laurent (laurent.orseau at gmail.com)
Date: Sat May 24 04:25:53 EDT 2014

Hi Roman,

Out of curiosity:
I'm having difficulties finding a case where that would be necessary,
unless when using an object there is a check to see if its class has the
method or not, or if the class system does that itself and does nothing in
case the method does not exist (instead of raising an exception).
IMHO this would be better implemented with a void method in the parent
class that can be overridden, or by implementing interfaces and check if
the object is of one interface or the other. Override-or-declare doesn't
strike me as good OO design (but if C++ does it, maybe there's a good
reason).
Could you give a simple use case?

Laurent


On Sat, May 24, 2014 at 8:16 AM, Roman Klochkov <kalimehtar at mail.ru> wrote:

> Is there a way to make C++ way inheritance: if superclass has the method,
> then override, else create new?
>
> I see in manual, that public requires " method must not be present already
> in the superclass" and override requires "definition already present in the
> superclass".
>
> Is it possible to not restrict the superclass?
>
>
> --
> Roman Klochkov
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140524/e16347e4/attachment.html>

Posted on the users mailing list.