comp.lang.ada
 help / color / mirror / Atom feed
From: "ME" <abcdefg@nonodock.net>
Subject: Re: Ada Gems in educational material
Date: Fri, 7 Mar 2008 21:50:56 -0800
Date: 2008-03-07T21:50:56-08:00	[thread overview]
Message-ID: <13t4a9thd0dkr85@corp.supernews.com> (raw)
In-Reply-To: <f34a2d2c-879c-415c-ba4e-657195c92c34@34g2000hsz.googlegroups.com>

"Jerry" <lanceboyle@qwest.net> wrote in message 
news:f34a2d2c-879c-415c-ba4e-657195c92c34@34g2000hsz.googlegroups.com...
On Mar 5, 8:48 am, Georg Bauhaus <rm.tsoh-plus.nicif-
bauh...@maps.futureapps.de> wrote:
> Gem #27: Changing Data Representation (Part 1) by Robert Dewar
> explains how to use type derivation if you want to have two
> representations of the same data. The types let you convert
> between an external and an internal representation, say.
>
> http://www.adacore.com/2008/03/03/gem-27/

I wonder if this works on records with discriminants.

Jerry

Yes it does. Tucker Taft showed me how to do it. I used nested discriminated 
records even. The problem is that if you have a whole buffer of ,for 
example,commands to convert i.e. an array you can't do the type conversion 
on the whole array at once.

Ada does not allow this.

There is a lot of flexibility of course you can specify where the 
discriminant goes in the record rep clause and even change the bit order.


Then there are the usual limitations with discriminated records like the 
invariant part must come first etc. 




      parent reply	other threads:[~2008-03-08  5:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 15:48 Ada Gems in educational material Georg Bauhaus
2008-03-06  5:35 ` Jerry
2008-03-06  9:49   ` Peter Hermann
2008-03-06 10:32   ` Georg Bauhaus
2008-03-08  5:50   ` ME [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