From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,997050aa5cf64c63 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-09-29 00:30:34 PST Path: bga.com!news.sprintlink.net!uunet!MathWorks.Com!europa.eng.gtefsd.com!swiss.ans.net!cmcl2!thecourier.cims.nyu.edu!thecourier.cims.nyu.edu!nobody From: dewar@cs.nyu.edu (Robert Dewar) Newsgroups: comp.lang.ada Subject: Re: Tagged type feature, or GNAT bug? Date: 28 Sep 1994 07:14:53 -0400 Organization: Courant Institute of Mathematical Sciences Message-ID: <36bj7d$osb@gnat.cs.nyu.edu> References: <369hme$e9j@felix.seas.gwu.edu> NNTP-Posting-Host: gnat.cs.nyu.edu Date: 1994-09-28T07:14:53-04:00 List-Id: 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