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-Thread: 103376,1cb75f0476fe2d1a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Half Constrained Array Types and Slices Date: 10 Mar 2006 12:33:46 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1141667416.163432.304280@p10g2000cwp.googlegroups.com> <1pfxe79p64svi.1txsf811gbkrr.dlg@40tude.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1142012026 3320 192.74.137.71 (10 Mar 2006 17:33:46 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 10 Mar 2006 17:33:46 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:3325 Date: 2006-03-10T12:33:46-05:00 List-Id: "Dmitry A. Kazakov" writes: > 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". Note quite infinite, since X'Last <= Natural'Last for all Strings X. And I suppose the highest value of String is: (Positive => Character'Last) This leads nowhere useful! ;-) If you want "arrays" indexed by strings, you really want sparse arrays implemented as hash tables or some such. I call those "mappings", not "arrays". See the Containers library of Ada 2005. >... After all [universal] floating-point ranges are allowed in Ada, > and they aren't finite... And they're not allowed in 'for' loops, nor as array indices. Which is a good thing. - Bob