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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: SI Units Checked and Unchecked Date: Thu, 9 Aug 2018 18:07:23 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <9381f30a-a957-4477-b037-b2d60041e83e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 9 Aug 2018 16:07:24 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="b22cdb2c7219d3c31b81b335ef847c6b"; logging-data="2247"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+N+I2Yv8zvaPGd/VQnQNd4UDKSqy/9+nY=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 Cancel-Lock: sha1:5NdYIUBdSHm4fXhjbCqR5Rl5fyE= In-Reply-To: <9381f30a-a957-4477-b037-b2d60041e83e@googlegroups.com> Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:54111 Date: 2018-08-09T18:07:23+02:00 List-Id: On 08/09/2018 02:44 PM, AdaMagica wrote: > > The base type is private: > > type Item is private; > > There are subtypes defined for all 7 base units defined in the SI system and many more: > > subtype Length is Item with Dynamic_Predicate => has_Dimension (Length, "m"); > subtype Volume is Item with Dynamic_Predicate => has_Dimension (Volume, "m**3"); > subtype Speed is Item with Dynamic_Predicate => has_Dimension (Speed , "m/s"); > subtype Force is Item with Dynamic_Predicate => has_Dimension (Force , "N"); > subtype Resistance is Item with Dynamic_Predicate => has_Dimension (Resistance, "Ohm"); > > Variables are defined like this: > > A: Acceleration := 5.0*"m/s**2"; > V: Speed := 10.0*"km/h"; > T: Time := 1.0*"min"; > D: Length := V*T + 0.5*A*T**2; Is this standard Ada 12, or is it GNAT specific? -- Jeff Carter "I was in love with a beautiful blonde once, dear. She drove me to drink. That's the one thing I'm indebted to her for." Never Give a Sucker an Even Break 109