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!postnews.google.com!j33g2000cwa.googlegroups.com!not-for-mail From: brian.b.mcguinness@lmco.com Newsgroups: comp.lang.ada Subject: Re: Half Constrained Array Types and Slices Date: 8 Mar 2006 09:36:38 -0800 Organization: http://groups.google.com Message-ID: <1141839398.185715.100670@j33g2000cwa.googlegroups.com> References: <1141667416.163432.304280@p10g2000cwp.googlegroups.com> NNTP-Posting-Host: 192.153.135.59 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1141839405 6126 127.0.0.1 (8 Mar 2006 17:36:45 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 8 Mar 2006 17:36:45 +0000 (UTC) In-Reply-To: <1141667416.163432.304280@p10g2000cwp.googlegroups.com> User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: j33g2000cwa.googlegroups.com; posting-host=192.153.135.59; posting-account=R0BKUQwAAAAEH1zhMKQoEzkWfZJu3USj Xref: g2news1.google.com comp.lang.ada:3295 Date: 2006-03-08T09:36:38-08:00 List-Id: Jeff Carter wrote: > 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; > > Suppose we could say something like > > V : Degenerate (null range); -- V'Length = 0 > > Now we can do things like > > for I in V'range loop -- loop is not entered > > if X in V'range -- always False > > Y : Degenerate (V'range); -- Y'Length = 0 > > More importantly, we do these kinds of things in subprograms with > Degenerate parameters. > > If Degenerate is a string type, "" is meaningful. > > 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. Probably a failure of imagination on my part. Perhaps I misunderstand you, but hasn't this capability already been provided in the Vector container? --- Brian