comp.lang.ada
 help / color / mirror / Atom feed
From: Daniel Wild <dan@example.com>
Subject: Re: Rep spec for tagged type
Date: 14 Aug 2004 19:10:09 +0930
Date: 2004-08-14T19:10:09+09:30	[thread overview]
Message-ID: <873c2qdpmu.fsf@goofinder.dyndns.org> (raw)
In-Reply-To: cfii07$98j$1@a1-hrz.uni-duisburg.de

Georg Bauhaus <sb463ba@l1-hrz.uni-duisburg.de> 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.



  reply	other threads:[~2004-08-14  9:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-13 11:17 Rep spec for tagged type Daniel Wild
2004-08-13 14:08 ` Georg Bauhaus
2004-08-14  9:40   ` Daniel Wild [this message]
2004-08-13 17:07 ` Nick Roberts
replies disabled

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