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-Thread: 103376,db88d0444fafe8eb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!feeder.xsnews.nl!news.germany.com!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Surprise in array concatenation Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1125544603.561847.32140@g47g2000cwa.googlegroups.com> <14muavojz308w.1ouv7xin79rqu$.dlg@40tude.net> <4316e8ff$0$24161$9b4e6d93@newsread4.arcor-online.net> Date: Thu, 1 Sep 2005 15:59:28 +0200 Message-ID: <1ckzkebgd9rdq.pubzw2q4ps6m$.dlg@40tude.net> NNTP-Posting-Date: 01 Sep 2005 15:59:28 MEST NNTP-Posting-Host: b0b957c9.newsread2.arcor-online.net X-Trace: DXC=MmKY2MN=fA0RTD7Kih:TB8Q5U85hF6f;4jW\KbG]kaM8Q>n?D9BSA]<95ImeW[h1P2WRXZ37ga[7:n919Q4_`Vj9B8=X\UUgbk4 X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:4371 Date: 2005-09-01T15:59:28+02:00 List-Id: On Thu, 01 Sep 2005 13:42:37 +0200, Georg Bauhaus wrote: > Dmitry A. Kazakov wrote: > >> A more interesting question is why Empty'First does not raise any >> exception. > > Because 'First does not denote an element? Because it does not exist. Consider a discrete type with one or even no elements. >> After all, there is no any lower bound of an empty index range. > > ? What's the bound of a range? (as opposed to a bounded array) The bound of the index range. Array itself has no any bounds, its index may have them. >> Provided, that empty arrays are all same, of course. If not, then another >> interesting question would appear: how to make an empty array with the >> lower bound Integer'First? > > Carrying the arguement further, how to reference an element > outside the machine's storage? This way: raise Constraint_Error; -- (:-)) -------------- The problem with the current (Ada 83) design is that it tries to abstract away trivial mathematical facts: 1. Not all sets have bounds 2. Even if a set is bounded it does not necessarily contain the bound. Further trivial fact: 3. [a, a-1] is not an empty set. It might be an interval of negative length, whatever meaning that may have. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de