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,8eff44ec1bcf8433 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-22 19:09:37 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!netnews.com!xfer02.netnews.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3BD4D157.C96BBAAD@acm.org> From: Jeffrey Carter X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Container reqs References: <9qctpn$lil$1@news.huji.ac.il> <3nCy7.29644$ev2.35903@www.newsranger.com> <9qfgla$7sb$3@news.huji.ac.il> <9qnflg$pm$1@news.huji.ac.il> <3BCF57C8.DE99D9C@boeing.com> <3BD0E523.E23FB134@acm.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 23 Oct 2001 02:09:37 GMT NNTP-Posting-Host: 158.252.128.151 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 1003802977 158.252.128.151 (Mon, 22 Oct 2001 19:09:37 PDT) NNTP-Posting-Date: Mon, 22 Oct 2001 19:09:37 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net X-Received-Date: Mon, 22 Oct 2001 19:05:49 PDT (newsmaster1.prod.itd.earthlink.net) Xref: archiver1.google.com comp.lang.ada:15058 Date: 2001-10-23T02:09:37+00:00 List-Id: Stephen Leake wrote: > > PragmARC does _not_ support indefinite types, which are a large part > of Ada (strings, unconstrained variant records, tagged types with > unconstrained discriminants). In addition, the comment says "no > scalars"; I'm not clear why. That is correct. Raw indefinite types are not reasonable types to store in a data structure. If you need to store strings, you should be using an abstraction such as (Un)Bounded_String. Similar abstractions should be used for other indefinite types. The problem with scalars is that there is a range check required on copy in for a scalar parameter of mode in out. The PragmARCs pass uninitialized objects of type Element to the To parameter of Assign. If Element is a scalar subtype (such as Positive) and an object's uninitialized value is out of the subtype's range (-7), Constraint_Error would be raised. For scalar types that cannot have an out of range value (Integer), this is not an issue, but for a simple-minded rule, no scalars is easily stated. It is a simple matter to wrap a scalar in a record if it's really needed, but experience shows that data structures are almost always used for more complex types. It's a reasonable trade off for being able to handle limited types without access types. > So I don't think PragmARC meets the criteria of "simple instantiation > for all reasonable Ada types". > > Perhaps we disagree on the meaning of "reasonable" here. So it would seem. I think SAL doesn't provide simple instantiation for any Ada type. -- Jeffrey R. Carter PragmAda Software Engineering