From: Ken Garlington <kennieg@nospam.flash.net>
Subject: Re: Beware: Rep spec on an enumeration type causes code explosion
Date: 1997/12/12
Date: 1997-12-12T00:00:00+00:00 [thread overview]
Message-ID: <3491E0BF.3D18@nospam.flash.net> (raw)
In-Reply-To: mheaney-ya023680001212970109560001@news.ni.net
Matthew Heaney wrote:
>
> In article <3490B7B1.711A@nospam.flash.net>,
> Ken.Garlington@nospam.computer.org wrote:
>
> >> Contiguous := Contiguous_Type (Holey);
> >> -- implicitly does equivalent of 'Pos
>
> >This assumes Holey will always be one of A, B, C, D, E. What happens
> >when the underlying
> >I/O device returns a value of 6 for Holey?
>
> Of course, you must always check for validity prior to the conversion,
>
> if Holey'Valid then
> Contiguous := Contiguous_Type (Holey);
> else
> <handle error>
> end if;
which is the same as my original statement, to wit: "One of the nice
things about 'holey' representations in Ada, when used for interfacing
to external systems, is the use of 'Valid to check for valid input data
in a very readable manner. However, I would convert the raw input to a
non-holey type after the check, using either a map or case statement
(depending upon the compiler)."
A response to this statement was: "There is no need for anything so
elaborate." The corresponding code did the conversion without a
check, which prompted me to ask how validity was handled.
> --------------------------------------------------------------------
> Matthew Heaney
> Software Development Consultant
> <mailto:matthew_heaney@acm.org>
> (818) 985-1271
next prev parent reply other threads:[~1997-12-12 0:00 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-12-05 0:00 Beware: Rep spec on an enumeration type causes code explosion Joe Gwinn
1997-12-06 0:00 ` Robert Dewar
1997-12-08 0:00 ` Joe Gwinn
1997-12-06 0:00 ` Robert Dewar
1997-12-06 0:00 ` Kevin D. Heatwole
[not found] ` <dewar.881478386@merv>
1997-12-07 0:00 ` Robert Dewar
1997-12-09 0:00 ` Jim Gleason
1997-12-06 0:00 ` Tucker Taft
1997-12-06 0:00 ` Robert Dewar
1997-12-06 0:00 ` Robert Dewar
1997-12-08 0:00 ` Joe Gwinn
1997-12-08 0:00 ` Mats Weber
1997-12-09 0:00 ` Geert Bosch
1997-12-10 0:00 ` Robert Dewar
1997-12-09 0:00 ` Tucker Taft
1997-12-09 0:00 ` Matthew Heaney
1997-12-10 0:00 ` Charles Hixson
1997-12-10 0:00 ` Ken Garlington
1997-12-11 0:00 ` John G. Volan
1997-12-11 0:00 ` Ken Garlington
1997-12-12 0:00 ` Matthew Heaney
1997-12-12 0:00 ` Ken Garlington [this message]
1997-12-16 0:00 ` John G. Volan
1997-12-17 0:00 ` Ken Garlington
1997-12-12 0:00 ` Alan E & Carmel J Brain
1997-12-12 0:00 ` Robert Dewar
1997-12-15 0:00 ` Tucker Taft
1997-12-16 0:00 ` Brian Rogoff
1997-12-12 0:00 ` Joe Gwinn
1997-12-12 0:00 ` Robert Dewar
1997-12-16 0:00 ` John G. Volan
1997-12-17 0:00 ` Joe Gwinn
1997-12-17 0:00 ` John G. Volan
1997-12-18 0:00 ` Joe Gwinn
1997-12-17 0:00 ` Ken Garlington
1997-12-10 0:00 ` Stephen Leake
1997-12-14 0:00 ` Robert Dewar
1997-12-10 0:00 ` Stanley R. Allen
1997-12-14 0:00 ` Robert Dewar
1997-12-10 0:00 ` Robert Dewar
1997-12-10 0:00 ` Jean-Pierre Rosen
1997-12-11 0:00 ` Rakesh Malhotra
1997-12-11 0:00 ` Matthew Heaney
1997-12-12 0:00 ` Robert Dewar
1997-12-12 0:00 ` Rakesh Malhotra
1997-12-12 0:00 ` Samuel Tardieu
1997-12-12 0:00 ` Robert Dewar
1997-12-14 0:00 ` Alan E & Carmel J Brain
1997-12-12 0:00 ` Joe Gwinn
1997-12-15 0:00 ` Robert Dewar
1997-12-16 0:00 ` Joe Gwinn
1997-12-16 0:00 ` Robert Dewar
1997-12-06 0:00 ` David Marshall
1997-12-06 0:00 ` Robert Dewar
1997-12-06 0:00 ` Matthew Heaney
1997-12-10 0:00 ` GNORT information ( Was Re: Beware: Rep spec on an enumeration type causes code explosion ) Mark Bennison
1997-12-10 0:00 ` Robert Dewar
1997-12-06 0:00 ` Beware: Rep spec on an enumeration type causes code explosion Ken Garlington
1997-12-06 0:00 ` Corey Minyard
1997-12-08 0:00 ` Joe Gwinn
1997-12-10 0:00 ` Robert Dewar
1997-12-06 0:00 ` Robert Dewar
1997-12-08 0:00 ` Joe Gwinn
1997-12-09 0:00 ` Stanley R. Allen
1997-12-06 0:00 ` Robert Dewar
1997-12-07 0:00 ` Larry Kilgallen
-- strict thread matches above, loose matches on Subject: below --
1997-12-09 0:00 tmoran
1997-12-11 0:00 Marin David Condic, 561.796.8997, M/S 731-96
1997-12-11 0:00 ` Robert Dewar
1997-12-11 0:00 Marin David Condic, 561.796.8997, M/S 731-96
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox