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-Thread: 103376,9fb8e2af320d5b3e X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Bus error Date: Fri, 29 Jun 2007 22:02:24 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1182954233.788124.17920@c77g2000hse.googlegroups.com> <1182959120.13096.8.camel@kartoffel> <1182964748.689146.52490@c77g2000hse.googlegroups.com> <1183061209.600996.74710@k79g2000hse.googlegroups.com> <1183104348.439715.173430@q75g2000hsh.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1183168948 29947 192.74.137.71 (30 Jun 2007 02:02:28 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 30 Jun 2007 02:02:28 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:clZcHBhefSoiNKWcnwltIzivq1o= Xref: g2news1.google.com comp.lang.ada:16348 Date: 2007-06-29T22:02:24-04:00 List-Id: Maciej Sobczak writes: > On 28 Cze, 23:19, Robert A Duff wrote: > >> >> No. You can have an untagged private type whose full type is tagged. >> >> > You mean - untagged *public*, I suppose? >> >> Yeah, the terminology is confusing. > > Yes, I meant "untagged public view". If any such thing exists. :-) The RM term is "partial view". >> I mean: >> >> package P is >> type T is limited private; >> private >> type T is tagged limited ...; >> end P; >> >> or: >> >> with Ada.Finalization; use Ada; >> package P is >> type T is limited private; >> private >> type T is new Finalization.Limited_Controlled with ...; >> end P; > > Yes, or even stricter: > > with Ada.Finalization; use Ada; > package P is > type T (<>) is limited private; > private > type T is new Finalization.Limited_Controlled with ...; > end P; > > which prevents uninitialized objects. As written, it prevents clients from creating ANY objects of type T. Clients cannot create uninitialized objects ("X:T;", or "new T;") because of the (<>). And clients cannot create initialized objects, because no functions are exported. In a real example, T might be Set, and there would be some functions like: function Empty_Set return Set; function Intersection (...) return Set; The (<>) means clients can't create objects of type Set without initializing them with some function under control of the Sets package. >> Most AdaCore folks do not read comp.lang.ada at all. > > Interesting. > Do they have so many official user complaints to read that they don't > have any time left? :-) > > Hey, I can afford this joke, if they don't read it, right? ;-) - Bob