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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9cccf6ef6149fdaa X-Google-Attributes: gid103376,public From: Charles Hixson Subject: Re: Operators -> unit analysis Date: 2000/01/05 Message-ID: <3873B648.792D578@earthlink.net>#1/1 X-Deja-AN: 568806435 Content-Transfer-Encoding: 7bit References: <38620350.48F8FC08@gecm.com> <83u8l0$5i5$1@nnrp1.deja.com> <84rd2f$snm$1@nntp3.atl.mindspring.net> <84thof$9r3$1@nntp4.atl.mindspring.net> <387383D0.4EA02E95@earthlink.net> <3873a69a_1@news1.prserv.net> X-Accept-Language: en X-Posted-Path-Was: not-for-mail Content-Type: text/plain; charset=us-ascii X-ELN-Date: 5 Jan 2000 21:23:19 GMT X-ELN-Insert-Date: Wed Jan 5 13:25:04 2000 Organization: EarthLink Network, Inc. Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-01-05T00:00:00+00:00 List-Id: Matthew Heaney wrote: > ... > You can already do this: > > Speed := Miles'(37.0) / Hours'(1.5); > > I always recommend type qualification for literals when units are an > issue. > That handles the units problem, but the syntax is still backwards for how it needs to be read. I suppose there's no way out. (And I'm being picky). But: Speed := Miles'(37.0) / Hours'(1.5); is read as: Speed := (37.0)'Miles / (1.5)'Hours; And even there, for a simple statement like this I would prefer: Speed := 37.0'Miles / 1.5'Hours; Actually, this would probably be as near to optimal as is realizable. But defining each unit separately has problems. I like the general approach used by Pat Rogers: > I have a facility somewhat like that on the "free code page" at my web > site: > > http://www.classwide.com/products/freecode.htm > > Look for the "dimensioned units" section (at the bottom). > > -- > Pat Rogers Training and Consulting in: > http://www.classwide.com Deadline Schedulability Analysis > progers@classwide.com Software Fault Tolerance > (281)648-3165 Real-Time/OO Languages > as it feels more "generalizeable".