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,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5037bf0bb33408c8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-08 05:00:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!freenix!enst.fr!not-for-mail From: "Grein, Christoph" Newsgroups: comp.lang.ada Subject: Re: "&" for array versus "&" for Strings Date: Tue, 8 Oct 2002 13:53:47 +0200 (MET DST) Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-Trace: avanie.enst.fr 1034078404 82997 137.194.161.2 (8 Oct 2002 12:00:04 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Tue, 8 Oct 2002 12:00:04 +0000 (UTC) Return-Path: X-Authentication-Warning: mail.eurocopter.com: uucp set sender to using -f Content-MD5: C5CBL8haP07atfVpgwfnSg== X-Mailer: dtmail 1.2.1 CDE Version 1.2.1 SunOS 5.6 sun4u sparc Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.13 Precedence: bulk X-Reply-To: "Grein, Christoph" List-Unsubscribe: , List-Id: comp.lang.ada mail<->news gateway List-Post: List-Help: List-Subscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:29582 Date: 2002-10-08T13:53:47+02:00 > ------------------------------------------------------------------ > with Ada.Text_IO; use Ada.Text_IO; > procedure Array_Test is > > type Name_Array is array (Positive range <>) of String (1..6); > > procedure Print_Names (Names : Name_Array) is > begin > for No in Names'First .. Names'Last loop > Put_Line (Integer'Image(No) & ": " & Names (No)); > end loop; > end; > > begin > > Print_Names ("Ada " & "Babbel"); > > end Array_Test; > ------------------------------------------------------------------ > > Then the result becomes: > > 1: A 2: d 3: a 4: 5: 6: 7: B 8: a 9: b 10: b 11: e 12: l > Why is this happening. Which compiler do you use? Gnat 3.16w produces an error for this: preben.adb:15:17: expected type "Name_Array" defined at line 4 preben.adb:15:17: found a string type With qualification, it works. Print_Names (string'("Ada ") & string'("Babbel")); The problem cause needs an intensive RM exegesis, which I have just not the time for. Could be a compiler error.