From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,36a29c2860aff686 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!feeder.news-service.com!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Properties Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <3b84c8e7-1a51-4a7c-9646-119f1fc51478@s4g2000yql.googlegroups.com> <4pnv7nl4cdui$.1n28i7lqk4mek$.dlg@40tude.net> <1k7367gtebsgm$.18auo6u3nfg34.dlg@40tude.net> <083addb2-61f6-4a69-bb81-2e4fa640783b@e16g2000pri.googlegroups.com> <124c5qinlvj7c$.1pdr35p7hkp11.dlg@40tude.net> <75475874-cd6c-4e75-8a2f-7675ecf0864a@f20g2000vbc.googlegroups.com> Date: Fri, 3 Dec 2010 23:38:35 +0100 Message-ID: <1x7ohnuflqoqs.58dfeefat1q2.dlg@40tude.net> NNTP-Posting-Date: 03 Dec 2010 23:38:33 CET NNTP-Posting-Host: 1862d522.newsspool3.arcor-online.net X-Trace: DXC=^FjRW24F^GAAa;:RKVJ>LEMcF=Q^Z^V3H4Fo<]lROoRA8kF On Fri, 3 Dec 2010 11:52:22 -0800 (PST), Shark8 wrote: > On Dec 3, 2:05�am, "Dmitry A. Kazakov" > wrote: >> The bottom line, interfaces must be removed from Ada. >> Instead of that an interface must be made inheritable >> from any concrete type. This is the same idea as with >> abstract record, array etc types. > > Wouldn't this be alleviated by two things: > Allowing INTERFACE [keyword] objects to have fields (properties as > I've described, or somesuch)? These are different problems: 1. Record interface, this is in effect what you proposed: type Members is interface record A : Integer; -- Not a physical member only an interface "Object.A" end record; [I want other interfaces too, like array interface, access interface etc.] 2. Interface inheritance. Let you have some type: type T is tagged ... procedure Foo (X : T); You have to replace it to type Interface_of_T is interface; procedure Foo (X : Interface_T) is abstract; type T is ... and Interface_of_T ... overriding procedure Foo (X : T); In order to be able to say: type S is ... and Interface_of_T ... overriding procedure Foo (X : S); It is boring. Each type obviously has an interface, which must be inheritable from. > Allowing objects some sort of self/this/me attribute where the result > is a Not Null Access to its classwide-type*? (Or am I misunderstanding > what you mean by the need for "a fat pointer transparent to all widget > operations"?) I mean this: -- Anything you can do with a widget type Widget_Interface is limited interface; procedure Draw (Object : in out Widget_Interface) is abstract; ... -- Implementation of a widget type Widget_Object is new Widget_Interface with ...; overriding procedure Draw (Object : in out Widget_Object); type Widget_Object_Ptr is access all Widget_Object; -- Public interface of a widget, a reference type Widget is new Ada.Finalization.Controlled and Widget_Interface with record Ptr : Widget_Object_Ptr; end record; overriding procedure Draw (Object : in out Widget); procedure Draw (Object : in out Widget) is begin Draw (Object.Ptr.all); end Draw; Widget_Object is private, publicly accessible is its fat pointer/handle Widget. Both implement the same interface Widget_Interface. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de