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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!1.eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?B?QmrDtnJuIEx1bmRpbg==?= Newsgroups: comp.lang.ada Subject: Re: Ada design bug or GNAT bug? Date: Sat, 04 Jul 2015 14:00:57 +0200 Organization: A noiseless patient Spider Message-ID: References: <4lrj5zz2u2z.u8x9cf7xzic6.dlg@40tude.net> <58f64fa9-7d0b-44dd-870c-77d9afcb82c4@googlegroups.com> <4228c0ea-837d-42a0-b2a8-a98d8d30f820@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 4 Jul 2015 11:58:12 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="d2d02d9cc3d0011cde6cddd52020399a"; logging-data="15791"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX184NFFbMqklQedQPn4oj8dU" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0 In-Reply-To: Cancel-Lock: sha1:jXF8q/dzg91cWw9eRBp4sFNfYtQ= Xref: number.nntp.giganews.com comp.lang.ada:193916 Date: 2015-07-04T14:00:57+02:00 List-Id: On 2015-07-04 09:46, Simon Wright wrote: > Shark8 writes: > >> Also, I seem to recall your dislike of INTERFACEs -- in hindsight, >> what would you have done differently if you needed the mechanism of >> "Type T has functions X, Y, and X" applied to a group of types? >> Generics, or some variations thereof? > > Generic signature packages? > I had this problem when implementing another companies proprietary communications protocol, that we needed to communicate with. The physical devices were picking-robots. All messages had a common headers and then message specific fields. And they had to have certain functions. To_String, Save_to_Database, Send, etc. Since I had complete control over the implementation, I ended up using inheritance from an abstract type. Some functions of the abstract type were implemented, and others - to specialized for the inherited type - was declared abstract. -- Björn