comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Tagged type feature, or GNAT bug?
Date: 28 Sep 1994 07:14:53 -0400
Date: 1994-09-28T07:14:53-04:00	[thread overview]
Message-ID: <36bj7d$osb@gnat.cs.nyu.edu> (raw)
In-Reply-To: 369hme$e9j@felix.seas.gwu.edu

Obviously you can't have an array of type'Class, because the whole point is
that you don't know till link time what the maximum size of such an object
would be. So if you think about it Mike, you have no implementation model
for how that would work except to introduce pointers, and the solution is
simple enough: introduce the pointers in the code. Always work with pointers
to T'Class, not T'Class objects themselves.

Actually that's good advice in the variant record case too. In general the
business of allocating the maximum possible space doesn't work so well even
for variant records where you know all the possibilities statically. Some
Ada 83 compilers (RR?) introduce hidden pointers in this case, and others
(ALsys) allocate the maximum space, but place an arbitrary limit on the
maximum size permitted.

It's helpful always to think about what your implementation model is when
you run into something like this. If you can't think of a simple model, then
very likely there is a problem!

Robert




      parent reply	other threads:[~1994-09-28 11:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-09-27 16:36 Tagged type feature, or GNAT bug? Michael Feldman
1994-09-27 23:22 ` Bob Duff
1994-09-28 11:14 ` Robert Dewar [this message]
replies disabled

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