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,2078dddcdcd8d83 X-Google-Attributes: gid103376,public From: dsmith@clark.net (Doug Smith) Subject: Re: Warning: Religious naming convention discussion :-) [was: assign help!!] Date: 1997/05/19 Message-ID: #1/1 X-Deja-AN: 243265848 References: <5kjvcv$evt@news.cis.nctu.edu.tw> <5kn8ko$jcc@top.mitre.org> <1997May7.201035.2439@nosc.mil> <33727EEA.2092@sprintmail.com> <5kuf1j$17vi@uni.library.ucla.edu> <3373666A.31DFF4F5@spam.innocon.com> <5li43j$ur3@castor.cca.rockwell.com> <6650FD690224F234.CA8B0C59DCFC9927.43A53422559505C5@library-proxy.airnews.net> Organization: Clark Internet Services, Inc. Newsgroups: comp.lang.ada Date: 1997-05-19T00:00:00+00:00 List-Id: In article <6650FD690224F234.CA8B0C59DCFC9927.43A53422559505C5@library-proxy.airnews.net>, clines@delete_this.airmail.net (Kevin Cline) wrote: > wemagor@sym1.cca.rockwell.com (Wayne Magor) wrote: > > >It's pretty important to know that Altitude is in feet and not nautical miles > >or meters. It's also pretty important to know what is in Degrees and what > >is in Radians. This is the most straightforward and elegant solution, IMHO. > > It's not important if direct conversion to or from a numeric type is > impossible. I am not set on one approach or another. However, I do prefer something like: with Linear_Measurement; ... type Altitude is private; function Feet (Value : in Linear_Measurement.Feet) return Altitude; function Miles (Value : in Linear_Measurement.Miles) return Altitude; ... function Feet (Value : in Altitude) return Linear_Measurement.Feet; function Miles (Value : in Altitude) return Linear_Measurement.Miles; ... This suggests an architecture, but a fully detailed solution would include some package hierarchy and/or abstract type for handling units without the need to declare all conversions for all dimensions. Doug