From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,66bb9de12d0a33f9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-12-03 21:12:47 PST Path: bga.com!news.sprintlink.net!hookup!news.kei.com!ub!csn!perez From: perez@oldcolo.com (Carlos Perez) Newsgroups: comp.lang.ada Subject: Re: Dimensional Data Types Date: 4 Dec 1994 05:09:35 GMT Organization: Old Colorado City Communications (oldcolo.com - login "newuser") Message-ID: <3briug$9ab@news-2.csn.net> References: NNTP-Posting-Host: 192.160.122.1 X-Newsreader: TIN [version 1.2 PL2] Date: 1994-12-04T05:09:35+00:00 List-Id: 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