comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Real syntax problems in Ada
Date: Tue, 28 Aug 2012 15:59:01 -0700 (PDT)
Date: 2012-08-28T15:59:01-07:00	[thread overview]
Message-ID: <ee82bb9f-2803-41a9-bd16-fafd68ff0005@googlegroups.com> (raw)
In-Reply-To: <fff2e952-74bb-4288-a04d-e040345a2310@googlegroups.com>

On Tuesday, August 28, 2012 2:25:09 PM UTC-7, Shark8 wrote:
> On Tuesday, August 28, 2012 3:07:32 PM UTC-6, Adam Beneschan wrote:
> 
> > On Tuesday, August 28, 2012 1:53:01 PM UTC-7, Shark8 wrote:
> 
> > 
> 
> > In the past, I've wanted something like (null array), which would be consistent since Ada already has (null record).  The language would have to define what the actual bounds of the array are, however, since a program can still refer to A'First or A'Last and they have to be defined to be something.  Starting with Ada 2005, it's now possible to say (1..0 => <>), which makes things better than they were before--at least there's no more problem of having to come up with a dummy value to put on the right side of the arrow.
> 
> 
> 
> Except in the case of an array of not null access values. :(
> 
> (At least w/ GNAT; it rejects <> because the default is null, which is excluded.)

Hmmm... I can't even get GNAT to display a warning.  I'm using 4.5.2.

Anyway, the behavior seems wrong; I can't find any Legality Rule that makes it illegal to declare an uninitialized object of any kind whose type is null-excluding access.  Of course it will raise Constraint_Error at runtime, although it won't in a (1..0 => <>) case since the program doesn't attempt to initialize any values.  I'm sure GNAT has a nonstandard mode that will reject a program if it "knows" there is something that is sure to raise an exception like this, but it shouldn't be doing it here.

                     -- Adam





  reply	other threads:[~2012-08-28 22:59 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-28  8:13 Real syntax problems in Ada Dmitry A. Kazakov
2012-08-28 10:20 ` Georg Bauhaus
2012-08-28 10:47 ` Niklas Holsti
2012-08-28 11:33   ` J-P. Rosen
2012-08-31 13:35     ` Robert A Duff
2012-08-28 13:27 ` Vasiliy Molostov
2012-08-28 15:23   ` Dmitry A. Kazakov
2012-08-28 20:18     ` Vasiliy Molostov
2012-08-29  7:25       ` Dmitry A. Kazakov
2012-08-29 10:47         ` Vasiliy Molostov
2012-08-29 11:58           ` Dmitry A. Kazakov
2012-08-30 17:38             ` Vasiliy Molostov
2012-08-28 15:14 ` Adam Beneschan
2012-08-28 16:18   ` J-P. Rosen
2012-08-28 16:39   ` Dmitry A. Kazakov
2012-08-28 21:38     ` Randy Brukardt
2012-08-29  6:58       ` Dmitry A. Kazakov
2012-08-29 10:43         ` stefan-lucks
2012-08-29 10:58           ` stefan-lucks
2012-08-29 13:14           ` Niklas Holsti
2012-08-29 17:52             ` stefan-lucks
     [not found]             ` <fbps38pgcuf8fgioptt39s6u7dme1aqs7r@invalid.netcom.com>
2012-09-02 10:16               ` svaa
2012-08-29 13:33           ` Georg Bauhaus
2012-08-29 17:20             ` Jeffrey Carter
2012-08-29 17:51             ` stefan-lucks
2012-08-30  9:12               ` Georg Bauhaus
2012-08-28 21:49   ` Randy Brukardt
2012-08-28 23:09     ` Adam Beneschan
2012-08-29  7:34     ` Egil Høvik
2012-08-28 19:41 ` Florian Weimer
2012-08-28 20:53   ` Shark8
2012-08-28 21:07     ` Adam Beneschan
2012-08-28 21:25       ` Shark8
2012-08-28 22:59         ` Adam Beneschan [this message]
2012-08-29  7:06       ` Dmitry A. Kazakov
2012-08-30 21:08         ` Randy Brukardt
2012-08-30 22:06 ` sbelmont700
2012-08-30 22:34   ` Adam Beneschan
2012-08-30 22:54     ` William Findlay
2012-08-31  7:39     ` Dmitry A. Kazakov
replies disabled

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