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 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: Fri, 10 Mar 2006 09:46:32 +0100 Message-ID: <1pfxe79p64svi.1txsf811gbkrr.dlg@40tude.net> NNTP-Posting-Date: 10 Mar 2006 09:46:31 MET NNTP-Posting-Host: 3523eef3.newsread2.arcor-online.net X-Trace: DXC=nRD1m\ER7FlhlIa[YhA;>cQ5U85hF6f;djW\KbG]kaMhZmYl>WOG@=ed6k@k3`FIUg[6LHn;2LCVn7enW;^6ZC`dIXm65S@:3>o X-Complaints-To: usenet-abuse@arcor.de Path: g2news1.google.com!news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!213.132.189.2.MISMATCH!multikabel.net!feed20.multikabel.net!tudelft.nl!txtfeed2.tudelft.nl!feeder.xsnews.nl!217.145.39.3.MISMATCH!talisker.lacave.net!lacave.net!feed.ac-versailles.fr!proxad.net!proxad.net!newsfeed.arcor.de!news.arcor.de!not-for-mail Xref: g2news1.google.com comp.lang.ada:3323 Date: 2006-03-10T09:46:31+01:00 List-Id: On Fri, 10 Mar 2006 04:28:59 GMT, Jeffrey R. Carter wrote: > Robert A Duff wrote: >> >> I don't quite see the point of this. If 'Length = 0, >> it seems to me, then the index type must be some sort of integer, >> or something like that. It depends on how far afield you want >> to go. For example, do you like "array(String range <>) of Integer"? > > I think the index type should be discrete. No. It should have some interface, which we could call an "abstract index type." If that type is ordered then ranges have meaning. Strings are ordered, so ranges are theoretically OK. [ Discreteness does not imply ranges. Modular types is an example of a discrete type, which is very difficult for ranges. Order is more important. ] >> There's no _range_ there... There is, but for most of finite bounds a string range would contain an uncountable number of items. For example "A".."B". This range includes "AA", "AAA", etc. This might be is undesirable, however, it would be interesting to think about how to deal with bounded infinite ranges, like "A".."B". After all [universal] floating-point ranges are allowed in Ada, and they aren't finite... >> The idea that 'Range is equivalent to 'First..'Last seems reasonable to >> me... > > I'm not saying it's a good idea. I'm just wondering what the consequences of it are. I don't think this idea is good. Mathematicians confront this issue as well. So they introduced open and closed sets and carefully distinguish Min from Inf and Max from Sup. What about range notations equivalent to ]a,b] or (a,b]? First..Last is like [a,b]. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de