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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,85ee038f08622eb8 X-Google-Attributes: gid103376,public From: jsa@alexandria (Jon S Anthony) Subject: Re: Array Literals? Date: 1996/08/13 Message-ID: #1/1 X-Deja-AN: 173992189 sender: news@organon.com (news) references: <4uo9b6$qj1@Masala.CC.UH.EDU> organization: Organon Motives, Inc. newsgroups: comp.lang.ada Date: 1996-08-13T00:00:00+00:00 List-Id: In article <4uo9b6$qj1@Masala.CC.UH.EDU> cosc19z5@Bayou.UH.EDU (Spasmo) writes: > type Int_Array is array(Integer range <>) of Integer; > > procedure Print_Int_Array ( I_List : Int_Array ) is > begin > for I in I_List'Range loop > Put_Line( Integer'Image ( I_List(I) ) ); > end loop; > end Print_Int_Array; > > > Now when we call it, is it standardly acceptable to > call it as such: > > Print_Int_Array ( (1, 2, 3, 4) ); > > Where (1, 2, 3, 4) is an array literal? Yes. That is simply an array aggregate and the type comes from the context which sez it is an Int_Array. No different than a : Int_Array := (1, 2, 3, 4); > I know it > works in GNAT3.05 but I want to make sure this isn't > a fluke and that I can depend on this behavior > regardless of which implementation I use. ^^^^^^^^^^ Well, the implementation could always be broken! :-) But, you should be OK. > So this would mean that array literals are in fact > flexible enough to be used anywhere an array can > be used eh? If the shoe fits! /Jon -- Jon Anthony Organon Motives, Inc. 1 Williston Road, Suite 4 Belmont, MA 02178 617.484.3383 jsa@organon.com