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,791ecb084fdaba75 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-09-29 01:01:23 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!howland.reston.ans.net!swrinde!news.dell.com!tadpole.com!uunet!noc.near.net!inmet!corsair!brennan From: brennan@corsair.warm.inmet.com (William Brennan) Subject: Re: Types with physical dimension Message-ID: Sender: news@inmet.camb.inmet.com Organization: Intermetrics, Inc. References: Date: Wed, 28 Sep 1994 17:36:19 GMT Date: 1994-09-28T17:36:19+00:00 List-Id: In article , Paul Graham wrote: > >One can model physical types in Ada by using private types, but this >involves writing a lot of operators. What do Ada programmers do to guard >against dimensional errors? > Ummm... I did it by using private types and writing a lot of operators. Yes, it's a bit unwieldy. But once it's done, it's done. Well, not really. If you want to create subtypes to have automatic constraint checking performed, you have to modify the package to add subtype definitions which I don't like too much. It would be best if the package remained totally stable, and subtypes could be added without surgery. Ada 9X may fix this with child units, but it doesn't do much for us living with Ada 83. If anyone wants to see an example of what I've got so far, please send me e-mail. These packages are still a work in progress, being done in my spare time. -- ---------------------------------------------------------------------------- === Team-Ada member === Bill Brennan brennan@panther.warm.inmet.com