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,72137304956d9360 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-23 13:29:59 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsmi-us.news.garr.it!NewsITBone-GARR!news.mailgate.org!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: generic imports? void* -> generics? Date: 23 Sep 2003 21:28:13 +0100 Organization: Pushface Sender: simon@smaug.pushface.org Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1064348997 15644 62.49.19.209 (23 Sep 2003 20:29:57 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Tue, 23 Sep 2003 20:29:57 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Xref: archiver1.google.com comp.lang.ada:42823 Date: 2003-09-23T21:28:13+01:00 List-Id: "Randy Brukardt" writes: > I would consider providing both. Yes .. > This will be hard to use, because you have > to declare an aliased, unconstrained buffer to be able to match the > discriminant. > > Buf : aliased Stream_Element_Array (1..10); > > won't work. Yes .. Buf : aliased Stream_Element_Array := (1 .. 10 => 0); means you end up writing to the darn thing anyway. GNAT users can take their lives in their hands & used 'Unrestricted_Access on a non-aliased object, of course. > > I ask because (in another package) I had a Controlled type with a > > visible Initialize and someone mistakenly called it .. I know they > > could have done anyway, but its being there in the public part of > > the package tempted them. > > It's best if the abstraction can withstand extra calls to Initialize > and Adjust; it has to withstand extra calls to Finalize (as they can > happen in abort situations). I can see the Initialize -- not so sure how you could tell about extra Adjusts?