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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1116ece181be1aea X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-02 07:18:13 PST Path: archiver1.google.com!news2.google.com!newsfeed.stanford.edu!lnsnews.lns.cornell.edu!news.litech.org!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!in.100proofnews.com!in.100proofnews.com!cycny01.gnilink.net!cyclone1.gnilink.net!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.gbronline.com!news.gbronline.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 02 Oct 2003 09:18:58 -0500 Date: Thu, 02 Oct 2003 09:18:19 -0500 From: Wes Groleau Reply-To: groleau@freeshell.org Organization: Ain't no organization here! User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en, es-mx, pt-br, fr-ca MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Counter-proposal for variable arrays References: <3F739C1D.4030907@attbi.com> <3F78E850.8010401@comcast.net> <3F797748.3000203@noplace.com> <834clb.uan1.ln@skymaster> <3F79EF18.7060600@comcast.net> <3F7B1076.8060106@comcast.net> <5mknnv4u96qqudrt4bd8n4t1cljp2fjlp8@4ax.com> In-Reply-To: <5mknnv4u96qqudrt4bd8n4t1cljp2fjlp8@4ax.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 69.9.86.17 X-Trace: sv3-m367qR1LnRFE1gn2klBBRy0c6BjshduCqBonNp4blamzmLrHsrdyXZzpO4AjDdkrgBoOlGV1c1MYfcW!w4t8sHjE3tEop5Tik0+7cZ1pzwVhTFD37cyAdSfR6bfL/RKRVcGg/QgfckBwozhyb8qgozULjUnE X-Complaints-To: abuse@gbronline.com X-DMCA-Complaints-To: abuse@gbronline.com 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.1 Xref: archiver1.google.com comp.lang.ada:120 Date: 2003-10-02T09:18:19-05:00 List-Id: Dmitry A. Kazakov wrote: > Which only means that there is a deficiency in array design. They have > to be allowed to have discriminants. Then: Even better (if it doesn't open some can of worms) would be (sub)type Variable (Lower : := := default) is array (Lower .. Upper) of ; Varies : Variable; equivalent to type Variable (Lower : := := default) is record Actual : array (Lower .. Upper) of ; end record; Varies : Variable; except that any operation legal for Varies.Actual in the second case would be legal for Varies in the first including operations that would change the value of the discriminant in a deterministic way, like Varies := Varies & Varies; (same rules as records regarding variants declared fixed) and defaults may be omitted - same rules as record discriminants and discriminant names are flexible and either discriminant may be omitted if both uses of that discriminant are literals or already declared entities and the name of an array (sub)type may be used instead of "array" in which case it will be a variable length subtype of the other with the same constraint rules as unvarying subtypes. I don't see any major difficulty with this (though I have not thought about it for very long). However, I have doubts whether it can be extended to multidimensional arrays. If it is practical to extend it that way, with all currently legal array operations, I would enthusiastically support it. If practicality required limitations compared to current arrays, it would depend on whether the disadvantage of inconsistency outweighs the potential benefits. -- Wes Groleau ----------- Daily Hoax: http://www.snopes2.com/cgi-bin/random/random.asp