CVS difference for ais/ai-00227.txt

Differences between 1.8 and version 1.9
Log of other versions for file ais/ai-00227.txt

--- ais/ai-00227.txt	2002/01/19 00:42:36	1.8
+++ ais/ai-00227.txt	2002/04/26 20:15:16	1.9
@@ -498,3 +498,105 @@
 
 *************************************************************
 
+From: Laurent Pautet
+Sent: Tuesday, April 23, 2002  4:36 AM
+
+   type Stream_Element_Offset is range
+     -(2 ** (Standard'Address_Size - 1)) ..
+     +(2 ** (Standard'Address_Size - 1)) - 1;
+
+   subtype Stream_Element_Count is
+      Stream_Element_Offset range 0 .. Stream_Element_Offset'Last;
+
+   type Stream_Element_Array is
+      array (Stream_Element_Offset range <>) of aliased Stream_Element;
+
+   procedure Read
+     (Stream : in out Root_Stream_Type;
+      Item   : out Stream_Element_Array;
+      Last   : out Stream_Element_Offset)
+   is abstract;
+
+In some circumstances (network communication, for instance), Read can
+return an empty array and no exception should be raised as it is a
+valid behaviour. Last can be set for instance to Item'First-1. But,
+the problem occurs when Item'First = Stream_Element_Offset'First. In
+this case, reading an empty array raises Constraint_Error. When we
+look at Get_Line from Ada.Text_IO, Last can be set to Item'First
+because Last is of type Natural and Item'First of type Positive.
+
+I think that it would be much better to define Stream_Element_Array as
+follow:
+
+   type Stream_Element_Array is
+      array (Stream_Element_Count range <>) of aliased Stream_Element;
+
+*************************************************************
+
+From: Pascal Leroy
+Sent: Tuesday, April 23, 2002  1:36 PM
+
+... thereby causing Constraint_Error to be raised in all programs that use
+negative offsets, for the sole purpose of dealing with a rather obscure case
+that has been around for 7 years.
+
+*************************************************************
+
+From: Robert Dewar
+Sent: Tuesday, April 23, 2002  1:43 PM
+
+This proposal does not even get out of the starting gate it would be an
+horrible and gratuitous upwards incompatibility.
+
+It should be a starting point for any revision of Ada that it is required
+to be 100% upwards compatible with Ada 95.
+
+*************************************************************
+
+From: Randy Brukardt
+Sent: Tuesday, April 23, 2002  1:56 PM
+
+I raised this question in February 2000 (see the !appendix of AI-227). The
+conclusion was that it isn't a big enough surprise to worry about.
+
+I wrote up a confirmation AI on this question, and stumbled over another bug
+in the standard. Nothing in the standard says what Last is set to for an
+empty array. Your assumption that it is 'First-1 is not justified by the RM
+language. So the AI (approved by WG9, mostly likely will be in the
+Amendment) became a binding interpretation mainly covering that issue.
+
+There certainly is no reason to reopen this issue.
+
+*************************************************************
+
+From: Robert Duff
+Sent: Tuesday, April 23, 2002  2:01 PM
+
+So don't do that.  ;-)
+
+This issue was known during the language design -- see
+AARM-13.7.1(12.a-12.b) for a discussion.
+
+As I recall, Offer Pazy and I were waging war over whether the lower
+bound of the index subtype should be 0 or 1 (I don't remember which side
+I was on), and Tucker stepped in and pointed out that the *user* can
+choose, and also decided that negative bounds should be allowed.
+Normally, the user will choose either 0 or 1 as the lower bound.
+
+*************************************************************
+
+From: Randy Brukardt
+Sent: Tuesday, April 23, 2002  2:18 PM
+
+Thanks Bob, we've now reproduced virtually the entire thread that led to
+AI-227. I hope I don't have to write the AI again. :-)
+
+*************************************************************
+
+From: Laurent Pautet
+Sent: Tuesday, April 23, 2002  2:22 PM
+
+That's perfectly fine :) Thanks for the input and the pointer to AI-227.
+
+*************************************************************
+

Questions? Ask the ACAA Technical Agent