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,b553d2c02a2df59f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Fri, 24 Feb 2006 15:52:56 -0600 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: Subject: Re: limited types (Was: Records that could be arrays) Date: Fri, 24 Feb 2006 15:57:46 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-oDqB4i4BUQzjSITni+XybIGyYZI93EuAGHM1Mk8rvUnm4h0oFei0hcpP9zLWFoSNQssnpShO7H0q+MO!PRZvVJCr6JcqdYNtbv7e30EIUDNtdXFu7oP6TV+fqlNEhspAMUdC+Kiys+y+yYcglWhisVtE68nv!FnkOW34cIDwHrA== X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:3152 Date: 2006-02-24T15:57:46-06:00 List-Id: "Thierry Bernier" wrote in message news:Xns9774B59B784EFemailenonmoc@212.27.42.197... > Stephen Leake wrote : > > > If we implemented points as limited private types, we wouldn't be > > Please do not.limited is like the flu : a record containing a limited field must be > limited itself. > For example, you can not extend a Gtk.Window.Gtk_Window_Type with an > extension containing a limited type, or else the root of these types must > be limited (and I don't own it). > > limited should be used only when the type is really limited (when using > accesses, tasks, etc). > > Disagrees ? Limited is a flu, as you put it, but it is a pretty mild flu. Indeed, in Ada 200Y, it pretty much means that you can't assign it, and that's it. You can have aggregates and functions with suitable limitations. Indeed, many of us think that "limited" should be the default for Ada. (It certainly ought to be for interfaces and tagged types, because that allows more uses.) Only if you *need* assignment should something be non-limited. For example, your window example *should* be limited; it doesn't make sense to assign windows. (Yes, Claw does this wrong, too, mainly because of the limitations on the use of limited in Ada 95 that no longer apply.) That's especially valuable because then the extensions can include any kind of component. Of course, you often do need assignment. The containers are non-limited so that they can be composed. And that's because it doesn't make sense to have limited elements (as the elements have to be copied into the container). But in any case this is decision that needs to be made based on the use of the type, not for philosophical reasons... Randy.