From: "Grein, Christoph" <christoph.grein@eurocopter.com>
Subject: Re: "&" for array versus "&" for Strings
Date: Tue, 8 Oct 2002 13:53:47 +0200 (MET DST)
Date: 2002-10-08T13:53:47+02:00 [thread overview]
Message-ID: <mailman.1034078403.25693.comp.lang.ada@ada.eu.org> (raw)
> ------------------------------------------------------------------
> 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.
next reply other threads:[~2002-10-08 11:53 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-08 11:53 Grein, Christoph [this message]
2002-10-08 13:46 ` "&" for array versus "&" for Strings Preben Randhol
2002-10-08 13:49 ` Preben Randhol
2002-10-08 16:41 ` Robert A Duff
2002-10-09 9:35 ` Preben Randhol
-- strict thread matches above, loose matches on Subject: below --
2002-10-10 6:28 Grein, Christoph
2002-10-10 7:15 ` Preben Randhol
2002-10-10 4:35 Grein, Christoph
2002-10-10 6:06 ` Preben Randhol
2002-10-09 9:59 Grein, Christoph
2002-10-09 5:28 Grein, Christoph
2002-10-09 12:43 ` Robert A Duff
2002-10-09 17:38 ` Steven Deller
2002-10-09 19:46 ` Robert A Duff
[not found] <200210081153.NAA17399@bulgaria.otn.eurocopter.de>
2002-10-08 12:21 ` David C. Hoos, Sr.
2002-10-08 13:56 ` Sergey Koshcheyev
2002-10-08 15:46 ` David C. Hoos
2002-10-08 15:56 ` Preben Randhol
2002-10-08 10:57 Preben Randhol
2002-10-14 16:34 ` Eric G. Miller
2002-10-14 17:54 ` Robert A Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox