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=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,48bbfdbc3683ed X-Google-Attributes: gid103376,public From: Robert Dewar Subject: Re: Tagged Rep Spec Date: 1999/06/25 Message-ID: <7l04v5$61p$1@nnrp1.deja.com>#1/1 X-Deja-AN: 493772623 References: <7k5mop$n0i$1@nnrp1.deja.com> X-Http-Proxy: 1.0 x37.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Fri Jun 25 14:50:19 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.04 [en] (OS/2; I) Date: 1999-06-25T00:00:00+00:00 List-Id: In article , Matthew Heaney wrote: > On 15 Jun 1999 14:08, jsanchor@cs5.dasd.honeywell.com wrote: > > > I was wondering. Can a person Rep Spec a tagged record? > > The correct term is rep "clause." > > Although the RM allows you to specify a rep clause for a tagged type, I > don't see the point, since you don't know > > 1) how big the tag is > > 2) if the compiler needs the tag to be placed at a specific > offset > > 3) if there even is a tag These are not reasons for not specifying a rep clause, they are just reminders that the rep clause will likely be impl dependent, but then MANY rep clauses are impl dependent. The subset of portable rep clauses required by the RM is a small subset of the useful rep clauses, and in our experience real life large programs are full of all kinds of rep clauses outside the set required by the RM. For example, consider array packing. The RM requires close packing only for the cases of 1,2,4,8,16 etc bits. That's very restrictive. In GNAT we allow close packing for any component size up to 64 bits. That still may not be enough, we just got a request from a customer to support close packing for various sizes (136, 255) up to 256 bits. In the case of tagged types, the tag in GNAT is a single pointer sized object at offset 0 in the record. Rep clauses can be freely used to position the specified fields of the type, providing that the space for the tag is not stomped on. There are many useful uses of this capability. Robert Dewar Ada Core Technologies Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.