From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 12 Aug 93 21:23:18 GMT From: slinky.cs.nyu.edu!slinky.cs.nyu.edu!nobody@nyu.edu (Robert Dewar) Subject: Re: Unconstrained arrays Message-ID: <24ecc6$770@schonberg.cs.nyu.edu> List-Id: Jim Crigler suggests: Viewers : str_array (1 .. 1) := str_array'(Creat("text_artist")); No, no, no! The qualification is useful only to determine the type wanted,but we know what type we want (str_array!) The trouble is that the expression (Creat("Text_artists")) just isn't of that type, as I hope the previous answers have made clear. I would strongly suggest that people make a habit of testing out replies to queries of this kind by doing trial compilations with a reasonable Ada compiler. I certainly do (and I am supposed to know Ada!) I think this would result in fewer correcter responses to technical queries. In this case, I ran it on an Alsys version 5 compiler and got: . 8 Viewers2 : src_array (1 .. 1) := src_array'(Create("text_artist")); . <--------1---------> .1 **IDE There is a type inconsistency in this expression. . . . . =================================================== More Information = = . -> The context requires the following type(s): . - MAIN.SRC_ARRAY at line 3, an array type of STANDARD.INTEGER . -> But the expression has the following type(s) : . - STANDARD.INTEGER . ====================================================================== = A rather lengthy, but absolutely accurate, error message! I also ran it under GNAT, and got: 8. Viewers2 : src_array (1 .. 1) := src_array'(Create("text_artist")); | | error: expect type "src_array" in this context which isn't quite so verbose as the Alsys message, but is also accurate. Actually we generally operate in brief, Unix-compatible error message mode, which gives: "t.ada", line 8: error: expect type "src_array" in this context We usually find that the error flags aren't needed, and in any case we have added a column positioning feature to EMACS so that the error message handling in EMACS will position the cursor to the point of the error flag.