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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,730a7c3edfcae91f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-06 02:14:45 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!skynet.be!skynet.be!freenix!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: christoph.grein@eurocopter.com Newsgroups: comp.lang.ada Subject: Re: Macks - adding unit constants? Date: Thu, 6 Nov 2003 10:58:35 +0100 (MET) Organization: Cuivre, Argent, Or Message-ID: Reply-To: grein@egypt.otn.eurocopter.de NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1068113594 79470 80.67.180.195 (6 Nov 2003 10:13:14 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Thu, 6 Nov 2003 10:13:14 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: X-Authentication-Warning: mail.eurocopter.com: uucp set sender to using -f Content-MD5: +De4GD9DfQ/m5LX2VlBS8g== X-Mailer: dtmail 1.2.1 CDE Version 1.2.1 SunOS 5.6 sun4u sparc X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:2132 Date: 2003-11-06T10:58:35+01:00 > > Dist: constant SI := 0.000_86 * Meter; > > or > > Dist: constant SI := 0.86 * Milli * Meter; > > This is in some ways more to my taste. Here there are no conversions of > dimensionless numbers to dimensioned numbers. But I prefer the > compile-time checking I get with Macks to the run-time checking implied > in the above examples. Compile time checking will only work for simple cases satisfactorily. How are you going to handle fractional powers? (See my paper). How power series? Every now and then you will run into problems because a certain overloading of multiplication operators is not available and you have to reorder your expression in order to make it compile. With Macks, you still have the wrong overloadings (e.g. T*T giving T for any type T) still present, albeit abstract, and those _can_ screw up overloading resolution under certain conditions. ARG has abandoned a proposal for Ada05 that would have added unit checking at compile time because of the many problems that come with it. (One of the authors was Tucker Taft.) If you really want dimension checking in full generality (my personal feeling is, it's not worth it, real software problems are buried somewhere else, see Ada Europe Conference 2003, Springer Verlag *), you need a run-time method where dimensions can easily be switched off when the code has been subject to 100% coverage unit testing (because then you have _proved_ that all equations are dimensionally correct). (*) I can send you the PDF file if you're interested. Christoph Grein