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!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!th!lucks From: Stefan Lucks Newsgroups: comp.lang.ada Subject: Re: Half Constrained Array Types and Slices Date: Mon, 6 Mar 2006 20:49:29 +0100 Organization: InterNetNews at News.BelWue.DE (Stuttgart, Germany) Message-ID: References: <1141667416.163432.304280@p10g2000cwp.googlegroups.com> NNTP-Posting-Host: th.informatik.uni-mannheim.de Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: news.BelWue.DE 1141674571 11291 134.155.91.85 (6 Mar 2006 19:49:31 GMT) X-Complaints-To: news@news.belwue.de NNTP-Posting-Date: Mon, 6 Mar 2006 19:49:31 +0000 (UTC) In-Reply-To: <1141667416.163432.304280@p10g2000cwp.googlegroups.com> Xref: g2news1.google.com comp.lang.ada:3280 Date: 2006-03-06T20:49:29+01:00 List-Id: On Mon, 6 Mar 2006, Jeff Carter wrote: > 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. Don't use V'Last at all ... but a new attribute V'Beyond instead. Informally, V'Beyond should be the "next" value beyond V'last. To avod unneccessary runtime errors, such a (non-Ada-)language should rather not provide V'Last at all ... -- Stefan Lucks Th. Informatik, Univ. Mannheim, 68131 Mannheim, Germany e-mail: lucks@th.informatik.uni-mannheim.de home: http://th.informatik.uni-mannheim.de/people/lucks/ ------ I love the taste of Cryptanalysis in the morning! ------