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!news4.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: 09 Mar 2006 17:36:44 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1141667416.163432.304280@p10g2000cwp.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1141943804 18878 192.74.137.71 (9 Mar 2006 22:36:44 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 9 Mar 2006 22:36:44 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:3317 Date: 2006-03-09T17:36:44-05:00 List-Id: "Jeff Carter" writes: > Robert A Duff wrote: > > I'd also be happy to eliminate slices as l-values. They cause a lot of > > implementation difficulty for not much benefit. Or else go the whole > > hog, and allow X(5..10) := "xx", which does not work in Ada, because > > that would require changing the length of the whole thing. > > What would that do? It would replace the slice X(5..10) with a shorter one, thus shrinking the string. That's what you might want in a string-processing language... As I said, very not-Ada. > > Yes, but this is all very not-Ada in several ways. > > There are probably some semantic anomalies I have not considered. > > Of course, it's not-Ada by definition. But it's fun to talk about. Yes. > I've been thinking about a language that allows null arrays, even for > degenerate types like > > type Single is (One); > > type Degenerate is array (Single range <>) of Whatever; 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"? There's no _range_ there... The idea that 'Range is equivalent to 'First..'Last seems reasonable to me... - Bob