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,73f81e5f5d6ee80f X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: MI is sloppy Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: Date: Thu, 11 Dec 2008 11:02:58 +0100 Message-ID: <1g29uf1ygl1wc$.1x184o2bk9m0k$.dlg@40tude.net> NNTP-Posting-Date: 11 Dec 2008 11:02:58 CET NNTP-Posting-Host: 9b694129.newsspool3.arcor-online.net X-Trace: DXC=L^OLd1>\4]]aoembcbF;DQMcF=Q^Z^V3X4Fo<]lROoRQ^YC2XCjHcbYcNX<1=;Ii>WDNcfSJ;bb[UFCTGGVUmh?TLK[5LiR>kgRGAXGB7ZZ2d_ X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:2958 Date: 2008-12-11T11:02:58+01:00 List-Id: On Wed, 10 Dec 2008 18:40:46 -0600, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:d0goewygto13.10nsyzpabm3vn.dlg@40tude.net... >> On Fri, 5 Dec 2008 19:42:40 -0600, Randy Brukardt wrote: >> >>> A waste of effort. I don't believe in multiple inheritance (in any form); >>> it seems to me to be an excuse for sloppy design. >> >> It is like saying that a record with two components is a sloppy design. >> Either inheritance is a rubbish concept or else it is multiple. >> >> My pet example of MI is: >> >> type In_File is ...; >> procedure Get (File : in out Input_File; Item : out Data); >> >> type Out_File is ...; >> procedure Put (File : in out Output_File; Item : Data); >> >> type Inout_File is .. ? >> >> Is it sloppy? > > I tend to think so. These are insufficiently different to be types; there > should only be one type and different subtypes. Subtypes imply runtime > checks, but with good contracts most such errors can still be detected by > tools. And you don't have the goofy restrictions that come with trying to > make things separate types that aren't logically separate. Huh, I don't see any difference. Semantically type Inout_File is ... procedure Get (File : in out Inout_File; Item : out Data); procedure Put (File : in out Inout_File; Item : Data); subtype In_File is ...; procedure Get (File : in out Input_File; Item : out Data) is abstract; subtype Out_File is ...; procedure Put (File : in out Output_File; Item : Data) is abstract; Whatever way you go, incrementally adding operations or else incrementally removing them. But the second is certainly worse because it is statically uncheckable, it is a "God-class," it is potentially inefficient when only input is used, etc. (It is not the way programs are designed, if we could pick a ready program from the pool of all possible programs. (:-)) > This is very much like the attempt to statically check accessibility > (lifetime) of objects. It doesn't work, at least not in general. And we have > much better technology in terms of detecting errors without goofy > restrictions than we did when these rules were defined, so why not use > them?? I just do not believe that. IF there is a tool capable to read my mind and understand the program semantics and the reasonably warn me, THEN, please, build it into the compiler and make those warnings errors. If there is something (badly wrong) with that, then I don't need neither this tool nor its features in the compiler. Tools is cancer of compilers. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de