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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,87a27a72dee21611,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-05 17:02:20 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!howland.reston.ans.net!cs.utexas.edu!uunet!clsi!graham From: graham@clsi.COM (Paul Graham) Subject: Change in behavior of & operator between 83 and 9x? Message-ID: Followup-To: comp.lang.ada Sender: usenet@clsi.COM Organization: COMPASS Design Automation Date: 05 Oct 1994 16:04:49 GMT Date: 1994-10-05T16:04:49+00:00 List-Id: If an array type A has component type B which is itself an array type, is it possible to concatenate two arrays of type B to produce an array of type A? For instance: package foo is type my_string is array(1 .. 3) of character; type my_string_vector is array(positive range <>) of my_string; c1 : my_string_vector := "abc" & "def"; end; In this example, I want the value of the concanenation to be equivalent to ("abc", "def") -- my_string_vector(1 to 2) But it can also be interpreted as "abcdef" -- string(1 to 6), my_string(1 to 6), ??? which does not match the type of c1. The 83 RM (4.5.3(4)) states "if both operands are one-dimensional arrays, the result of the concatenation is a one-dimensional array whose length is the sum of the lengths of the operands ...". Clearly the concatenation of two strings is always a string, and never an array of strings. But the 9x RM defines the result of a concatenation in terms of its result type. In the above example the result type is known to be my_string_vector. Thus the "&" should be "&"(x, y : my_string) return my_string_vector. Is my understanding wrong, or is this an incompatibility between the 83 and 9x versions of Ada? Paul -- Paul Graham graham@compass-da.com Compass Design Automation, Inc. (speaking only for myself) "Cekoslovakyalilastiramadiklarimizdanmissiniz."