From: bobduff@world.std.com (Robert A Duff)
Subject: Re: To Initialise or not
Date: 1996/05/13
Date: 1996-05-13T00:00:00+00:00 [thread overview]
Message-ID: <DrD748.ECp@world.std.com> (raw)
In-Reply-To: 31975399.6F2C@lmtas.lmco.com
In article <31975399.6F2C@lmtas.lmco.com>,
Ken Garlington <garlingtonke@lmtas.lmco.com> wrote:
>I said that you should be able to use 'Size to ensure that an invalid
>representation of a scalar exists. AI95-00051 correctly points out that
>there will be at least two cases where this shouldn't happen:
But note that AI-51 has not yet been approved by the ARG. This AI was
considered at the November meeting, and I rewrote it to reflect my
understanding of the concensus. It will be considered again at the June
meeting, but the current (draft) version has no official status -- it's
just my personal opinion.
>So, what do you do then? Well, it seems to me that you could have, in
>the body of the abstraction, a check to see if an invalid value is
>possible. At least, you can check integers and enumeration values
>against System.Max_Int; I'm guessing there's a more general case that
>would handle modular types, and maybe the other cases,too. Anyway,
>assuming you could devise such a test, you could have that test done
>during the elaboration of the type abstraction and cause Program_Error
>to be raised. Then, you could have a second generic that would be used
>in those cases, which would have the type wrapped in a record that also
>contained a boolean called "Unset". The code in the ADT could
>initialize this to True, and then set it to False any time a Set
>operation was called. That's a little slow, but you would only need it
>for those types that can't have their own built-in out-of-range value,
>which should be a fairly small subset of the types in an average
>program.
Well, type Character uses all the bits up on most implementations, and
(in a packed array) Boolean uses up all the bits (namely 1 bit). Type
Integer uses up all the bits on most implementations. These aren't
things that you normally encapsulate in an "abstraction".
- Bob
next prev parent reply other threads:[~1996-05-13 0:00 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-04-29 0:00 To Initialise or not Steve O'Neill
1996-04-29 0:00 ` Ken Garlington
1996-04-29 0:00 ` Robert Dewar
1996-04-30 0:00 ` Ken Garlington
1996-04-30 0:00 ` Robert A Duff
1996-04-30 0:00 ` Ken Garlington
1996-04-30 0:00 ` Robert A Duff
1996-05-01 0:00 ` Keith Thompson
1996-05-01 0:00 ` Theodore E. Dennison
1996-05-01 0:00 ` Robert A Duff
1996-05-02 0:00 ` Theodore E. Dennison
1996-05-02 0:00 ` Chris Warack <sys mgr>
1996-05-02 0:00 ` Robert A Duff
1996-05-06 0:00 ` Ken Garlington
1996-05-02 0:00 ` Robert A Duff
1996-05-02 0:00 ` Michael F Brenner
1996-05-02 0:00 ` Robert A Duff
1996-05-04 0:00 ` Kevin D. Heatwole
1996-05-06 0:00 ` Ken Garlington
1996-05-07 0:00 ` Robert A Duff
1996-05-08 0:00 ` Ken Garlington
1996-05-08 0:00 ` Robert A Duff
1996-05-09 0:00 ` Ken Garlington
1996-05-09 0:00 ` Robert A Duff
1996-05-01 0:00 ` Dale Stanbrough
1996-05-02 0:00 ` Robert Dewar
1996-05-02 0:00 ` Theodore E. Dennison
1996-05-02 0:00 ` Robert A Duff
1996-05-01 0:00 ` Robert A Duff
1996-05-02 0:00 ` Keith Thompson
1996-05-03 0:00 ` Robert A Duff
1996-05-06 0:00 ` Ken Garlington
1996-05-06 0:00 ` Ken Garlington
1996-05-07 0:00 ` Robert A Duff
1996-05-08 0:00 ` Ken Garlington
1996-05-09 0:00 ` Robert A Duff
1996-05-10 0:00 ` Robert A Duff
1996-05-10 0:00 ` Ken Garlington
1996-05-10 0:00 ` Robert A Duff
1996-05-10 0:00 ` Ken Garlington
1996-05-11 0:00 ` Robert A Duff
1996-05-11 0:00 ` David Kristola
1996-05-11 0:00 ` Robert A Duff
1996-05-13 0:00 ` Ken Garlington
1996-05-13 0:00 ` Robert A Duff
1996-05-13 0:00 ` Ken Garlington
1996-05-13 0:00 ` Ken Garlington
1996-05-13 0:00 ` Robert A Duff [this message]
1996-05-13 0:00 ` Ken Garlington
1996-04-30 0:00 ` Robert A Duff
1996-05-01 0:00 ` Patrick Richard Wibbeler
1996-05-06 0:00 ` Ken Garlington
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox