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: g2news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sat, 06 Dec 2008 18:16:37 +0100 From: Georg Bauhaus Reply-To: rm.tsoh-bauhaus@maps.futureapps.de User-Agent: Thunderbird 2.0.0.18 (X11/20081125) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: MI is sloppy (was: Construction initialization problem) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <493ab375$0$31872$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 06 Dec 2008 18:16:37 CET NNTP-Posting-Host: 079eac56.newsspool3.arcor-online.net X-Trace: DXC=kTL6Wd[BLkHj7E:bke<5HFMcF=Q^Z^V3H4Fo<]lROoRA^YC2XCjHcbIVFX03I1?Jb@A:ho7QcPOVCXXm?^5Oj1;Bb5jJ:a]gUcB X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:3876 Date: 2008-12-06T18:16:37+01:00 List-Id: Dmitry A. Kazakov wrote: > 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 .. ? OK, I can use an object of type Inout_File both as In_File or as Out_File. OTOH, I'm unsure about the notion of Inout_File. Inout_File, despite being established in OSs, makes me think of a new model water tap that at the same time acts as a drain. I'd rather not approach this thing tired, with a razor in my hand... Similarly, is it proper design to make a two-way street appear to have only one polymorphic lane, i.e. think of streets as objects of a single MI type? I wouldn't want to drive there unless a big, proven apparatus of typing machinery, calling protocol, etc. makes sure that my car won't be driving along the wrong view of the street. I'm not sure but this seems like overhead to me. (Yes, I know there are cabins and speed trains and normal trains being directed this way. Without MI AFAIK, so I wonder how rail-bound traffic control could profit from MI. Will there have to be additional contracts for MI type that establish a proper order of object use?) Can't we just make Inout_File some composition and hide the details completely, behind a suitable collection of primitive operations? The type would be private, opaque, and nothing else.