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 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-06 15:12:53 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!howland.erols.net!news-out.worldnet.att.net.MISMATCH!wn3feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc53.POSTED!not-for-mail From: "Mark Lundquist" Newsgroups: comp.lang.ada References: <3C0A5054.E74A82E7@worldnet.att.net> <9ugs4v$8d7lj$1@ID-25716.news.dfncis.de> <3c0cc931.16965562@News.CIS.DFN.DE> <36c6f8dd.0112061152.333c9de@posting.google.com> <3C0FF376.2DC0C3E4@usa.com> Subject: Re: Dimensionality Checking (Ada 20XX) 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 Message-ID: Date: Thu, 06 Dec 2001 23:12:53 GMT NNTP-Posting-Host: 204.127.202.213 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc53 1007680373 204.127.202.213 (Thu, 06 Dec 2001 23:12:53 GMT) NNTP-Posting-Date: Thu, 06 Dec 2001 23:12:53 GMT Organization: AT&T Broadband Xref: archiver1.google.com comp.lang.ada:17543 Date: 2001-12-06T23:12:53+00:00 List-Id: "Wes Groleau" wrote in message news:3C0FF376.2DC0C3E4@usa.com... > > > Britt Snodgrass wrote: > > (dimensionality) in Ada code would be most naturally implemented as > > attributes of objects or types. The units of an object or type would > > be specified with a representation clause. If unspecified, the unit > > I think this is a very good idea. But now to nitpick: > > > Accel : Magnitude; > > for Accel'Unit use > > ISO_Metric_Units.Meter / ISO_Metric_Units.Second**2; > > In some cases, might there be multiple ways to describe > the units? Speed is Acceleration * Time but it is also > Distance / Time. Right, which is why (a) the concepts of "unit" and of "dimension" need to be loosely coupled (this is missing from the proposals I've seen so far), and then (b) you have to distinguish between base and derived dimensions. We normally think of Distance and Time as being "fundamental", so typically we would declare these as base dimensions. Then we declare the derived dimension Rate = Distance / Time. That's (a). (b) says that Rate = Distance / Time no matter the units. The dimensionality checking would be done in terms of base dimensions, so it makes no difference "how you got there", e.g. in terms of derived dimensions. Best Regards, Mark