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,FREEMAIL_FROM, LOTS_OF_MONEY 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 20:36:44 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!enews.sgi.com!news.xtra.co.nz!53ab2750!not-for-mail From: "AG" Newsgroups: comp.lang.ada References: Subject: Re: Private discrete type as index 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: Date: Sat, 18 Jan 2003 17:38:23 -0800 NNTP-Posting-Host: 219.88.60.166 X-Complaints-To: newsadmin@xtra.co.nz X-Trace: news.xtra.co.nz 1042864604 219.88.60.166 (Sat, 18 Jan 2003 17:36:44 NZDT) NNTP-Posting-Date: Sat, 18 Jan 2003 17:36:44 NZDT Organization: Xtra Xref: archiver1.google.com comp.lang.ada:33166 Date: 2003-01-18T17:38:23-08:00 List-Id: wrote in message news:adUV9.20206$hl1.1562@sccrnsc04... > >> Why so? Array is just a mapping index->element, so if no index ranges [ This was not my quote, I was responding to it ...] > >I suppose the answer will be that index ranges *are* required > >by the array semantics (in Ada, at least) > 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. No. What I was originally trying to do was an abstraction as close to the array as possible (booleans do not matter of course - just something to put there). At the same time, I wanted to restrict control of the index to the package implementing it (again, as much as possible). So, while I realise I can't (in Ada) provide things like "..", I can provide +/-/ operations of varying flavours on the index. This would keep most (not all, but most) of the array semantics in place. Unfortunately, this appears to be impossible. 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.