From: Alan Brain <aebrain@dynamite.com.au>
Subject: Re: Valid Attribute and Unchecked Conversion
Date: 1996/10/08
Date: 1996-10-08T00:00:00+00:00 [thread overview]
Message-ID: <325A0E03.7049@dynamite.com.au> (raw)
In-Reply-To: Dyr7Dt.HqL@world.std.com
Robert A Duff wrote:
>
> In article <DyqAKA.DJn@thomsoft.com>, Keith Thompson <kst@thomsoft.com> wrote:
> >Are sparse enumeration types are really used all that much in real life?
>
> They shouldn't be, because, as you explained, they don't work. Using
> sparse enums is asking for erroneousness.
>
> Well, it's not *quite* that bad: You can use a sparse enum for sending
> data from Ada to the outside world (e.g. doing output, passing
> parameters *to* an imported subprogram, unchecked converting *from* a
> sparse enum, etc). But the other direction doesn't always work, and
> should be avoided, IMHO.
Beg to differ; many systems send 0001, 0010, 0100, 1000 for the 4
different valid states, etc. You often get it coming and going in real
time apps. Even some disc controllers.
So you use a base type without representation (internally), and convert
to a represented derived type for output, and from a (maybe different)
represented derived type for input.
---------------------- <> <> How doth the little Crocodile
| Alan & Carmel Brain| xxxxx Improve his shining tail?
| Canberra Australia | xxxxxHxHxxxxxx _MMMMMMMMM_MMMMMMMMM
---------------------- o OO*O^^^^O*OO o oo oo oo oo
By pulling Maerklin Wagons, in 1/220 Scale
next prev parent reply other threads:[~1996-10-08 0:00 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-09-22 0:00 Rules for Representation of Subtypes Matthew Heaney
1996-09-23 0:00 ` David C. Hoos, Sr.
1996-09-23 0:00 ` Robert A Duff
1996-09-23 0:00 ` Samuel T. Harris
1996-09-26 0:00 ` David C. Hoos, Sr.
1996-09-24 0:00 ` Robert Dewar
1996-09-26 0:00 ` Keith Thompson
1996-09-26 0:00 ` Matthew Heaney
1996-09-27 0:00 ` Robert A Duff
1996-09-27 0:00 ` Robert Dewar
1996-09-27 0:00 ` Robert Dewar
1996-09-27 0:00 ` Robert A Duff
1996-09-24 0:00 ` Robert Dewar
1996-09-23 0:00 ` Robert A Duff
1996-09-24 0:00 ` Matthew Heaney
1996-09-26 0:00 ` Robert A Duff
1996-09-26 0:00 ` Larry Kilgallen
1996-09-27 0:00 ` Robert A Duff
1996-09-27 0:00 ` Mark A Biggar
1996-09-30 0:00 ` Robert A Duff
1996-10-01 0:00 ` Larry Kilgallen
1996-10-01 0:00 ` Robert A Duff
1996-10-01 0:00 ` Samuel Tardieu
1996-10-01 0:00 ` Ken Garlington
1996-10-01 0:00 ` Valid Attribute and Unchecked Conversion Matthew Heaney
1996-10-02 0:00 ` Robert A Duff
1996-10-04 0:00 ` Keith Thompson
1996-10-04 0:00 ` Matthew Heaney
1996-10-07 0:00 ` Robert Dewar
1996-10-09 0:00 ` Keith Thompson
1996-10-04 0:00 ` Robert A Duff
1996-10-04 0:00 ` Robert Dewar
1996-10-11 0:00 ` Norman H. Cohen
1996-10-12 0:00 ` Robert Dewar
1996-10-06 0:00 ` Keith Thompson
1996-10-07 0:00 ` Robert Dewar
1996-10-09 0:00 ` Keith Thompson
1996-10-07 0:00 ` Ken Garlington
1996-10-08 0:00 ` Alan Brain [this message]
1996-10-07 0:00 ` Kenneth Almquist
1996-10-07 0:00 ` Robert Dewar
1996-10-10 0:00 ` Ken Garlington
1996-10-11 0:00 ` Robert Dewar
1996-10-14 0:00 ` Ken Garlington
1996-10-14 0:00 ` Keith Thompson
1996-09-28 0:00 ` Rules for Representation of Subtypes Larry Kilgallen
1996-09-29 0:00 ` Robert A Duff
1996-09-29 0:00 ` Larry Kilgallen
1996-09-29 0:00 ` Matthew Heaney
1996-09-30 0:00 ` Robert A Duff
1996-10-01 0:00 ` Ken Garlington
1996-10-02 0:00 ` Robert A Duff
1996-10-02 0:00 ` Ken Garlington
1996-10-06 0:00 ` Robert Dewar
1996-09-29 0:00 ` Matthew Heaney
1996-09-30 0:00 ` Robert Dewar
1996-09-30 0:00 ` Matthew Heaney
1996-09-30 0:00 ` Robert A Duff
1996-10-03 0:00 ` Robert Dewar
1996-10-02 0:00 ` Valid Attribute and Unchecked Conversion George Haddad
1996-10-03 0:00 ` John Herro
1996-10-04 0:00 ` Karl Cooper {46901}
1996-10-07 0:00 ` Mark A Biggar
1996-10-08 0:00 ` Robert Dewar
1996-10-05 0:00 ` Robert Dewar
1996-10-06 0:00 ` Keith Thompson
1996-10-14 0:00 ` Robert A Duff
1996-10-02 0:00 ` Robert I. Eachus
1996-10-02 0:00 ` Matthew Heaney
1996-09-27 0:00 ` Rules for Representation of Subtypes Matthew Heaney
1996-09-27 0:00 ` Robert A Duff
-- strict thread matches above, loose matches on Subject: below --
1996-10-03 0:00 Valid Attribute and Unchecked Conversion Franco Mazzanti
1996-10-04 0:00 Franco Mazzanti
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox