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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f7a9613bbc2bd8c9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-15 03:07:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!fu-berlin.de!uni-berlin.de!pec-140-159.tnt9.hh2.uunet.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Generic default parameters Date: Wed, 15 May 2002 12:08:29 +0200 Message-ID: References: <60lvdu4ifauunm4qob6ir7rlas4soe0cp4@4ax.com> <8ep1eukksjmf65te5pvfreethdsbevsa9d@4ax.com> NNTP-Posting-Host: pec-140-159.tnt9.hh2.uunet.de (149.225.140.159) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1021457222 22030667 149.225.140.159 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:24082 Date: 2002-05-15T12:08:29+02:00 List-Id: On 14 May 2002 10:02:20 -0400, Stephen Leake wrote: >Dmitry A. Kazakov writes: > >> On 13 May 2002 12:42:45 -0400, Stephen Leake >> wrote: >> >> >Hmm, perhaps you _wanted_ IO.Handles.IO_Handle to be public, so >> >clients could do stuff. Simple : >> > >> >with Object.Handle; >> >package IO.Handles is >> > type IO_Handle is private; >> >private >> > package Handles is new Object.Handle (File_Descriptor, >> > File_Descriptor_Ptr); >> > type IO_Handle is new Handles.Handle with null record; >> > >> >end IO.Handles; >> >> Yes, but this would kill the nature of IO_Handle. It would be just a >> private or a tagged private type. All operations defined on Handle get >> invisible, as well as the fact that IO_Handle is a descendant of an >> instance of Object.Handle. > >Well, I don't know what you want. You started out saying you wanted an >"incomplete" type in the public part, with a full type in the private >part that was from a generic instantiation. This gives you that. No, it does not. I want the following: type IO_Handle is new Handles.Handle with null record; I cannot have that when Handles is an instance depending on some actual parameters invisible in the public part of the package. I must either move it to the private part, or make it [tagged] private. Both is unsatisfactory. >If you want "all operations defined on IO_Handle" to be visible, then why >do you want an "incomplete" type in the public part? Correction, all operations declared on its *parent*. >Why should a client know that IO_Handle is a derived type, especially >since the parent type is invisible? That's the point. The parent type shall be visible. >I guess I need to see an example of how you think a client would use >your new kind of type. That would make it clearer why a private type >won't work. The problem is to have [with generics] two parallel type sets, one public, one private: public: generic Handle File_Handle Sequential_File_Handle ... private: generic Object <--- File_Object <--- Sequential_File_Object ... Clients see only handles. Objects are private. Each time a package privately implements a new object type, some child package can instantiate a generic package to provide handles to objects. --- Regards, Dmitry Kazakov www.dmitry-kazakov.de