comp.lang.ada
 help / color / mirror / Atom feed
From: perez@oldcolo.com (Carlos Perez)
Subject: Re: Dimensional Data Types
Date: 4 Dec 1994 05:09:35 GMT
Date: 1994-12-04T05:09:35+00:00	[thread overview]
Message-ID: <3briug$9ab@news-2.csn.net> (raw)
In-Reply-To: D07KAr.767@ridgecrest.ca.us

Do-While Jones (do_while@owens.ridgecrest.ca.us) wrote:

: Since the USE clause makes the operators visible, I just write things like
: "VELOCITY := DISTANCE / TIME;" and Ada does all the dimensional checking
: for me.  If I write "VELOCITY := DISTANCE / VOLTS;", I naturally get an
: error message.  Of course I can respond to the error message by doing
: something really stupid, like "VELOCITY := DISTANCE / Seconds(VOLTS);", but
: I am not that dumb yet.

It appears to me that you have designed an idiot-resistant system
(there is no such thing as idiot-proof ;-) 

I thought that your VOLTS was a private type and so you can't type
cast VOLTS into SECONDS.  You may need to have some functions whose
sole purpose is to convert dimensional types into scalar (non-dim) types
like Volts_To_Float and Float_To_Volts so you can define new and improved
cross-dimensional operators such as "*". 

My point is that Ada won't permit a simple cast as you described, unless
I missed something? 

: Do-While Jones

When-Others Perez 



  reply	other threads:[~1994-12-04  5:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-12-03  0:06 Dimensional Data Types Do-While Jones
1994-12-04  5:09 ` Carlos Perez [this message]
1994-12-05  1:39   ` Carlos Perez
1994-12-05 15:00   ` Do-While Jones
replies disabled

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