comp.lang.ada
 help / color / mirror / Atom feed
From: Dale Stanbrough <dale@goanna.cs.rmit.EDU.AU>
Subject: Re: 'size attribute inheritance
Date: 1997/08/14
Date: 1997-08-14T00:00:00+00:00	[thread overview]
Message-ID: <5t018b$g3o$1@goanna.cs.rmit.edu.au> (raw)
In-Reply-To: EEwvGB.DD5@world.std.com


Matthew Heaney, mheaney@ni.net writes:
 I wouldn't suggest giving up strong typing completely, only at the
 interface layer of the system, where you're touching the metal (ie whenever
 you write O'Address).  Whatever data an interface abstraction presents to
 the rest of the system should be strongly typed, but I recommend that in
 the implementation of that abstraction, weak types be used to read in the
>data, and that the range of the input data be checked manually.


I would still use strong typing even at this level. Obviously out of range
values are a big problem, so don't declare types that could have out of range
values.

E.g. if you are reading in a 12 bit value from an A/D then declare...


	type AD_Reading is mod 2**12;


You still get the benefits of strong typing (can't accidentally convert to
an appropriately scaled/biased value) and no risk of Constraint_Error.


Dale




  reply	other threads:[~1997-08-14  0:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-08-09  0:00 'size attribute inheritance Carlos Palenzuela
1997-08-10  0:00 ` Robert Dewar
1997-08-11  0:00   ` Ken Garlington
1997-08-11  0:00   ` Matthew Heaney
1997-08-10  0:00 ` Matthew Heaney
1997-08-11  0:00   ` Robert Dewar
1997-08-12  0:00     ` Matthew Heaney
1997-08-13  0:00       ` Robert A Duff
1997-08-13  0:00         ` Matthew Heaney
1997-08-14  0:00           ` Robert A Duff
1997-08-14  0:00             ` Dale Stanbrough [this message]
1997-08-16  0:00           ` Robert Dewar
1997-08-16  0:00             ` Ken Garlington
1997-08-17  0:00               ` Robert Dewar
1997-08-18  0:00                 ` Robert A Duff
     [not found]                   ` <dewar.872433846@merv>
1997-09-03  0:00                     ` Robert A Duff
1997-09-06  0:00                       ` Robert Dewar
1997-09-08  0:00                         ` Robert A Duff
1997-08-17  0:00               ` Robert A Duff
1997-08-13  0:00       ` Ken Garlington
1997-08-13  0:00         ` Matthew Heaney
1997-08-10  0:00 ` Robert A Duff
replies disabled

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