comp.lang.ada
 help / color / mirror / Atom feed
* Access to Unconstrained Arrays
@ 1997-04-16  0:00 John Harbaugh
  1997-04-18  0:00 ` John Harbaugh
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: John Harbaugh @ 1997-04-16  0:00 UTC (permalink / raw)



When trying to pass pointers to objects of unconstrained array type, I
am getting confusing compiler errors.  For example:

procedure Main is
   type Lists is array(Natural range <>) of Integer;
   type Lists_Ptrs is access all Lists;

   procedure Do_Something(To : in out Lists_Ptrs) is...

   List1 : Lists(1..4) := (1,2,3,4);
   List2 : Lists       := (1,2,3,4);

begin
   Do_Something(To => List1);  -- Compilation Error.  Why?
   Do_Something(To => List2);  -- No problemo!!!
end Main;

List1 should be an anonymous constrained subtype of type Lists.  I was
under the impression that subtypes are simply a subset of their base
type.  Is this not the case for constrained subtypes of unconstrained
types?

Thanks in advance for any who may respond.

   - John




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

end of thread, other threads:[~1997-04-23  0:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-04-16  0:00 Access to Unconstrained Arrays John Harbaugh
1997-04-18  0:00 ` John Harbaugh
1997-04-20  0:00   ` Robert Dewar
1997-04-21  0:00   ` Joel VanLaven
1997-04-21  0:00     ` Robert A Duff
1997-04-23  0:00       ` Robert Dewar
1997-04-18  0:00 ` Joel VanLaven
1997-04-20  0:00   ` Robert Dewar
1997-04-18  0:00 ` Robert Dewar

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