From: cosc19z5@Bayou.UH.EDU (Spasmo)
Subject: Array Literals?
Date: 1996/08/12
Date: 1996-08-12T00:00:00+00:00 [thread overview]
Message-ID: <4uo9b6$qj1@Masala.CC.UH.EDU> (raw)
Hey all. I've got a question about array literals.
I looked through the RM (checked out the index and
hopped to the keywords that looked promising) but
I couldn't find the answer to this question.
Ok for my question. Is it valid on all Ada
implementations to provide array literals to
functions and the like? I know that Gnat let
me do it but I'd just like to make sure this
is guaranteed to work regardless of implementation.
For example:
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? 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.
So this would mean that array literals are in fact
flexible enough to be used anywhere an array can
be used eh?
Thanks in advance.
--
Spasmo
"Everyone has secrets, but sometimes you get caught,
So if it's just between us, my silence can be bought"
"Blackmail" by Sloppy Seconds
next reply other threads:[~1996-08-12 0:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-08-12 0:00 Spasmo [this message]
1996-08-13 0:00 ` Array Literals? John Herro
1996-08-13 0:00 ` Spasmo
1996-08-14 0:00 ` John Herro
1996-08-14 0:00 ` Robert I. Eachus
1996-08-13 0:00 ` Jon S Anthony
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox