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=-2.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,309015504ed37ff0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-30 02:55:08 PST Path: archiver1.google.com!news2.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.stueberl.de!teaser.fr!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: =?iso-8859-1?Q?M=E1rio_Amado_Alves?= Newsgroups: comp.lang.ada Subject: RE: Usage of Interfaces with Ada 95 Date: Tue, 30 Sep 2003 11:02:04 +0100 Organization: Cuivre, Argent, Or Message-ID: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1064915565 863 80.67.180.195 (30 Sep 2003 09:52:45 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Tue, 30 Sep 2003 09:52:45 +0000 (UTC) To: Return-Path: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300 X-OriginalArrivalTime: 30 Sep 2003 09:47:35.0484 (UTC) FILETIME=[E06F2FC0:01C38737] X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:3 Date: 2003-09-30T11:02:04+01:00 > > generic > > type Iterator_Type is private; > > with function Succ (Iterator : Iterator_Type) > > return Iterator_Type is <>; > > with procedure Process (Iterator : Iterator_Type) is <>; > > with function "=" (L, R : Iterator_Type) > > return Boolean is <>; > > procedure Generic_Algorithm (First, Back : Iterator_Type); > > I think the is a different view on the topic by defining a > functionality of an interface, providing a generic > implementation which defines the > interface for the programmer. This was exactly what i dont like to > do. I dont like to spent the effort of breaking down a concept into > a generic implementation. This is the reason why i like to > use interfaces. Somebody has to implement at some point. I think the example come short. There is a 'zero-implementation' way to specify interfaces in Ada: signature packages. The signature package for the stuff above is generic type Iterator_Type is private; with function Succ (Iterator : Iterator_Type) return Iterator_Type is <>; with procedure Process (Iterator : Iterator_Type) is <>; with function "=" (L, R : Iterator_Type) return Boolean is <>; with procedure Generic_Algorithm (First, Back : Iterator_Type) is <>; package Signature is end;