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,1cb75f0476fe2d1a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Half Constrained Array Types and Slices 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: <1141667416.163432.304280@p10g2000cwp.googlegroups.com> Date: Mon, 6 Mar 2006 19:31:16 +0100 Message-ID: <1nnb2k108agsq$.4f06q7j9rnj3$.dlg@40tude.net> NNTP-Posting-Date: 06 Mar 2006 19:31:07 MET NNTP-Posting-Host: 0e5db49b.newsread4.arcor-online.net X-Trace: DXC=@;[I31hY@8f_Pi]:Sm<]\d:ejgIfPPlddjW\KbG]kaMhQc4L4[MA2T`]n5Bo6C?JMd[6LHn;2LCVn[ On 6 Mar 2006 09:50:16 -0800, Jeff Carter wrote: > We seem to be fine as long as we don't do V'Last. I can't figure out > how such a language should handle 'First and 'Last for such a > value/object. Compile error, if the index type isn't ordered (= does not have 'First, 'Last, "<", "="). Otherwise, Constraint_Error. BTW, in the second case there is an interesting possibility, I didn't think much about. If the language had supertyping, then the compiler could create an anonymous supertype of the index type with one or two more values. These imaginary values could then be returned as 'First and 'Last. The idea is same as in IEEE's positive and negative infinities. Of course these values could have different representation than natural index. Yet the following will be illegal: I : Index := A'First; -- This may cause C_E while type conversion I know no good way to name the type. Even Index'Class would be wrong. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de