comp.lang.ada
 help / color / mirror / Atom feed
* Array Literals?
@ 1996-08-12  0:00 Spasmo
  1996-08-13  0:00 ` John Herro
  1996-08-13  0:00 ` Jon S Anthony
  0 siblings, 2 replies; 6+ messages in thread
From: Spasmo @ 1996-08-12  0:00 UTC (permalink / 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





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1996-08-14  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-08-12  0:00 Array Literals? Spasmo
1996-08-13  0:00 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox