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.9 required=5.0 tests=BAYES_00,LOTS_OF_MONEY autolearn=ham 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-13 14:15:20 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!ppp-1-26.cvx4.telinco.NET!not-for-mail From: "Nick Roberts" Newsgroups: comp.lang.ada Subject: Re: Dimensionality Checking (Ada 20XX) Date: Thu, 13 Dec 2001 22:15:33 -0000 Message-ID: <9vb98r$e9g47$1@ID-25716.news.dfncis.de> References: <11bf7180.0112070815.2625851b@posting.google.com> <9v0crt$bo2bi$1@ID-25716.news.dfncis.de> <9v37rs$cdmva$1@ID-25716.news.dfncis.de> NNTP-Posting-Host: ppp-1-26.cvx4.telinco.net (212.1.148.26) X-Trace: fu-berlin.de 1008281691 14991495 212.1.148.26 (16 [25716]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Xref: archiver1.google.com comp.lang.ada:17890 Date: 2001-12-13T22:15:33+00:00 List-Id: "Mark Lundquist" wrote in message news:Nn7S7.44589$ER5.535249@rwcrnsc52... > > > I'm not sure quite what you're getting at there, but it sounds like it > > might > > > be related to an issue I've been thinking about, which is that these > units > > > currently would not be able to work with "quasi-numeric" abstractions > such > > > as people define for things like rational numbers, infinite-precision > > > arithmetic, etc. > > > ... > > > > Correct. (The example presented to me was Ada.Calendar.Time). > > There you go... Calendar.Time is a perfect example. Yes. It is important to keep what is being proposed in perspective. If it has any merit at all, it will be limited. Nevertheless, I do believe it has merit. (Remember, we are not trying to solve all the world's problems at a single stroke ;-) > > > 1) You have to be able to handle logarithmic units... that's easy, for a > > > unit U: > > > > > > U'Log (B) -- denotes the log to the base B of U > > > U'Exp (B) -- denotes B to the power U > > > > Or alternatively, sticking closer to my design, the package Ada.Units > could > > have functions Log and Exp. This presumably means that the dimensions of a > > unit could be non-integral? > > No, you're holding your exponetiator backwards... here, like *this*... > that's more like it :-) > Non-integer exponents signify roots, not log/exp. Excellent Mark! I was wondering who would be the first to spot this. You get the prize*. It doesn't actually stop us handling logs and exps, in fact. It actually makes it easier: remember the idea of allowing user-defined dimension sets (passed as a generic parameter to a standard package)? We simply say that the log/exp units must belong to a different dimension set (and enforce this by checking). -- Best wishes, Nick Roberts *a big wet sloppy kiss ... from my cat, Roger (who is a she (really) :-)