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,602b7f606b0d64e2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-17 06:14:31 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn13feed!wn11feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!sccrnsc04.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Private discrete type as index References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc04 1042812870 12.234.13.56 (Fri, 17 Jan 2003 14:14:30 GMT) NNTP-Posting-Date: Fri, 17 Jan 2003 14:14:30 GMT Organization: AT&T Broadband Date: Fri, 17 Jan 2003 14:14:30 GMT Xref: archiver1.google.com comp.lang.ada:33127 Date: 2003-01-17T14:14:30+00:00 List-Id: >> >> type x is limited private; >> >> type test is array(x) of boolean; >> > The "array" abstraction has certain characteristics, among them >> > sequential indexing. >> Why so? Array is just a mapping index->element, so if no index ranges >I suppose the answer will be that index ranges *are* required >by the array semantics (in Ada, at least). But, as you pointed out: Perhaps to some people an array is a general map, but to me, and to at least the on-line glossaries I checked, it's not that general. Your abstraction appears to be a general mapping from elements of some set to booleans. Type "x" might be character strings and Test(x) True iff a symbol table has seen that string before. That's a perfectly good map, but, IMHO, not something well modeled as an array. My point is that your abstract object doesn't match the idea of "array" sufficiently well, and thus probably shouldn't be implemented with an array.