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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,842a00dafb20dd88 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Sender: dan@goofinder.dyndns.org Newsgroups: comp.lang.ada Subject: Re: Rep spec for tagged type References: <87n00z8exk.fsf@goofinder.dyndns.org> From: Daniel Wild Date: 14 Aug 2004 19:10:09 +0930 Message-ID: <873c2qdpmu.fsf@goofinder.dyndns.org> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: ppp36-58.lns1.adl1.internode.on.net X-Trace: duster.adelaide.on.net 1092476409 150.101.36.58 (14 Aug 2004 19:10:09 +0950) Path: g2news1.google.com!news2.google.com!news.maxwell.syr.edu!news.mel.connect.com.au!duster.adelaide.on.net!not-for-mail Xref: g2news1.google.com comp.lang.ada:2728 Date: 2004-08-14T19:10:09+09:30 List-Id: Georg Bauhaus writes: > There may be another possibility, if the representation > is important for some data items in the objects, but not > for all of the object. You could create a plain record type > "around" the data that you want in your tagged type. > Then provide a representation clause for the plain record, > and declare a component of the plain record type in the > tagged type. I thought about this, and it sort of works but not quite. If I take this approach then I have to code all the operations on the derived types twice. What I ended up doing was to leave the tagged types alone with no rep spec, then create separate types with rep specs. Then I just convert to/from these types when reading/writing them. Cheers, Daniel.