comp.lang.ada
 help / color / mirror / Atom feed
From: Stefan Lucks <lucks@th.informatik.uni-mannheim.de>
Subject: Re: Half Constrained Array Types and Slices
Date: Mon, 6 Mar 2006 20:49:29 +0100
Date: 2006-03-06T20:49:29+01:00	[thread overview]
Message-ID: <Pine.LNX.4.58.0603062041520.23677@th.informatik.uni-mannheim.de> (raw)
In-Reply-To: <1141667416.163432.304280@p10g2000cwp.googlegroups.com>

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!  ------




  parent reply	other threads:[~2006-03-06 19:49 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-02  5:00 Half Constrained Array Types and Slices Jeffrey R. Carter
2006-03-02  8:34 ` Dmitry A. Kazakov
2006-03-02 15:34   ` Georg Bauhaus
2006-03-02 19:37     ` Dmitry A. Kazakov
2006-03-02 20:06   ` Jeffrey R. Carter
2006-03-02 20:37     ` Dmitry A. Kazakov
2006-03-02 21:01     ` Robert A Duff
2006-03-02 20:40   ` Robert A Duff
2006-03-02 14:32 ` Larry Kilgallen
2006-03-02 20:08   ` Jeffrey R. Carter
2006-03-02 20:48   ` Robert A Duff
2006-03-06  2:16     ` Larry Kilgallen
2006-03-06 18:50       ` Martin Krischik
2006-03-02 20:38 ` Robert A Duff
2006-03-03  5:15   ` Jeffrey R. Carter
2006-03-03  8:57     ` Dmitry A. Kazakov
2006-03-03 23:41     ` Robert A Duff
2006-03-06 17:50       ` Jeff Carter
2006-03-06 18:31         ` Dmitry A. Kazakov
2006-03-07 19:02           ` Jeff Carter
2006-03-08 14:29             ` Dmitry A. Kazakov
2006-03-09 22:44               ` Robert A Duff
2006-03-10  8:46                 ` Dmitry A. Kazakov
2006-03-06 19:49         ` Stefan Lucks [this message]
2006-03-08 17:36         ` brian.b.mcguinness
2006-03-08 17:56           ` Jeff Carter
2006-03-09 22:36         ` Robert A Duff
2006-03-10  4:28           ` Jeffrey R. Carter
2006-03-10  8:46             ` Dmitry A. Kazakov
2006-03-10 17:33               ` Robert A Duff
2006-03-10 21:24                 ` Dmitry A. Kazakov
2006-03-10 17:38             ` Robert A Duff
2006-03-11  0:19               ` Randy Brukardt
2006-03-11  1:43                 ` Jeffrey R. Carter
2006-03-11  8:38                   ` Niklas Holsti
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox