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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cc4f25d878383cc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-08 13:23:21 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!wn1feed!wn2feed!worldnet.att.net!4.24.21.153!chcgil2-snh1.gtei.net!cambridge1-snf1.gtei.net!news.gtei.net!bos-service1.ext.raytheon.com!bos-service2.ext.raytheon.com.POSTED!not-for-mail Message-ID: <3C1284C4.D02AF9B@sparc01.ftw.rsc.raytheon.com> From: Wes Groleau Reply-To: wwgrol@sparc01.ftw.rsc.raytheon.com X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en,es-MX,es,pt,fr-CA,fr MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Dimensions (was Re: Another Idea for Ada 20XX) References: <3C0AACCE.329CFB60@worldnet.att.net> <45601fc.0112031740.3e217c8a@posting.google.com> <3C0CF4E3.A53D20A7@sparc01.ftw.rsc.raytheon.com> <3C0EF0A0.9F42EDB4@adaworks.com> <7KbQ7.13821$L51.28784@rwcrnsc54> <3C118E95.B5F013C8@adaworks.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sat, 08 Dec 2001 16:23:16 -0500 NNTP-Posting-Host: 151.168.144.162 X-Complaints-To: news@ext.ray.com X-Trace: bos-service2.ext.raytheon.com 1007846599 151.168.144.162 (Sat, 08 Dec 2001 16:23:19 EST) NNTP-Posting-Date: Sat, 08 Dec 2001 16:23:19 EST Organization: Raytheon Company Xref: archiver1.google.com comp.lang.ada:17631 Date: 2001-12-08T16:23:16-05:00 List-Id: On another project, I implemented two variations of dimensioned numbers. package Units in the deliverable code was several KSLOC. It provided a ... is digits ... for each unit of measure on the project's allowed units list, all the conversion factors between them, and all the "legal" operators we could think of. There were two ways to create "*" or "/" (1) a generic that would always raise an exception or a generic that took left, right, and result types and a multiplier (conversion factor). It was a pain to write it and check it, but it worked well as part of a five MegaSLOC product. package Unitized_Numbers in the testing software used a private type with a Units discriminant and a value. Much smaller, easier to write, but the loss of attributes and other features of numeric types was a slight disadvantage. It would have been a much bigger disadvantage if it had to be used for any complicated algorithms. -- Wes Groleau http://freepages.rootsweb.com/~wgroleau