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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1592759aa83d0d45 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-29 09:47:13 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: Brian.Gaffney@myrealbox.com (Brian Gaffney) Newsgroups: comp.lang.ada Subject: Re: Suggestion for Ada 200x - Interface inheritance Date: 29 May 2003 09:47:12 -0700 Organization: http://groups.google.com/ Message-ID: <5e9b8c34.0305290847.20ea2300@posting.google.com> References: <0Pxza.699607$OV.652508@rwcrnsc54> NNTP-Posting-Host: 137.244.215.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1054226833 21472 127.0.0.1 (29 May 2003 16:47:13 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 29 May 2003 16:47:13 GMT Xref: archiver1.google.com comp.lang.ada:38001 Date: 2003-05-29T16:47:13+00:00 List-Id: Robert A Duff wrote in message news:... > "Steve" writes: > > > Java and C# use the concept of interface inheritance. What do you think of > > adding this feature to Ada? > > I think it's a good idea. There is an AI on this, and I think the ARG > is considering it one of the most urgent ones. Look up the AI, and see > what you think. > > - Bob (http://www.ada-auth.org/cgi-bin/cvsweb.cgi/AIs/AI-00251.TXT?rev=1.12) I looked briefly at this AI (though I haven't read it in detail -- so I might have missed something), and there's one thing about it that I don't understand: If Ada'0Y is to add the concept of Interfaces, why would it be added as an Interface _type_? I can understand Java and C# using a Class-based approach, but since Ada splits up the concepts of a 'Class' wouldn't it be more the Ada-Way to use a concept related to packages? For example an "abstract package" which must have a body provided at the 'instantiation' site. I don't think this example would work, but something like: generic type Data is private; abstract package This_Interface is ... or abstract package This_Interface (type Data is private) is ... along with ... type Mine is ... package My_Interface is new This_Interface(Mine); package body My_Interface is ... ... I don't like this since My_Interface would be a different scope than that containing Data, but perhaps a way could be devised to annotate the type definition: type Mine is ... with This_Interface(Mine) ... or type Mine is ... for Data'interface use This_Interface(Mine), That_Interface(Mine), ...;" The bodies for subroutines, etc. defined in the Interfaces would then be required to follow (within the freezing rules?). This would give the advantage of allowing it for all types, not just tagged types. --Brian