comp.lang.ada
 help / color / mirror / Atom feed
From: dewarr@my-dejanews.com
Subject: Re: unconstrained array clarification
Date: 1998/09/19
Date: 1998-09-19T00:00:00+00:00	[thread overview]
Message-ID: <6u1anp$eo4$1@nnrp1.dejanews.com> (raw)
In-Reply-To: WishList-1909981042300001@a1.phoenix-7.goodnet.com

In article <WishList-1909981042300001@a1.phoenix-7.goodnet.com>,
  WishList@2600.com (Technobabble) wrote:
> Greetings Tucker,
>
> Thanks for the excellent response to my problem.  Thanks also for being
> kind enough to see through my novice attempts at syntax and patient enough
> to really understand and attack this problem. I'm sorry for the late night
> off the cuff coding examples that introduced misleading errors and
> produced a frustrated audience, it's all my fault, sorry. Thanks for
> seeing through all of that !!!
>
> recall:
>
> >    xyz5_array : aliased xyz_array := (1..5 => 0);
> >
> > This requirement for subtype matching is a bit of a pain, but using 'Access
> > imposes some stringent requirements on matching of representation, and
> > for pointers to arrays, it can matter greatly whether the nominal
> > subtype is constrained or unconstrained (you'll have to trust me on
> > this one).
> >
> > : now I want to loop:
> >
> > : for I in This.XYZ(1)'RANGE
> > :      loop
> > :       ..........
> >
> >
> > : ???? Will this work ???  Is the syntax totally incorrect ???
> >
> > This can be made to work, with the above changes.
> >
> > It might be interesting to have some idea where you are headed
> > with all of this.  There might be a simpler overall solution.
> >
>
> What I want to do is to keep the addresses for several arrays of records
> of different lengths in an array of pointers. Then write the contents of
> each record to I/O.  The problem is to do this with only the array of
> pointers, if I don't want to keep track of the size of each array (number
> of records), and I want to use the RANGE attribute to determine the size.
> But the only way I have of getting to the array of records is via the
> pointer.  I didn't design this stuff either, it's adopted from legacy
> code. I'll re-code the stuff in GNAT with the changes you've supplied and
> see if I can get a good compile.
>
> Thanks,
> Richmond


Seems odd that this could be legacy code, since Ada 83 had no facilities
comparable to 'Access (at least not in reasonable coding styles).

>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




  reply	other threads:[~1998-09-19  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-19  0:00 unconstrained array clarification Technobabble
1998-09-19  0:00 ` dewarr
1998-09-19  0:00 ` Tucker Taft
1998-09-19  0:00   ` Technobabble
1998-09-19  0:00     ` dewarr [this message]
1998-09-22  0:00     ` Robert I. Eachus
replies disabled

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