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,ba9a717d172afa4f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-08-31 04:40:12 PST Sender: sjw@galadriel.frlngtn.gecm.com Newsgroups: comp.lang.ada Subject: Re: School Assignment--Can this be simplified? References: <39AD5DBD.972C97CA@brandonsd.mb.ca> <39AE0E2A.C11F53F4@baesystems.com> From: Simon Wright Date: 31 Aug 2000 12:31:58 +0100 Message-ID: Organization: Alenia Marconi Systems, ISD, Farlington X-Newsreader: Gnus v5.5/Emacs 20.3 NNTP-Posting-Host: galadriel.frlngtn.gecm.com X-Trace: 31 Aug 2000 12:31:50 GMT, galadriel.frlngtn.gecm.com Path: supernews.google.com!sn-xit-02!sn-east!supernews.com!news-feed.riddles.org.uk!freenix!codeine.org!grolier!btnet-peer0!btnet!newreader.ukcore.bt.net!pull.gecm.com!galadriel.frlngtn.gecm.com Xref: supernews.google.com comp.lang.ada:431 Date: 2000-08-31T12:31:58+01:00 List-Id: Martin Dowie writes: > 1. 'magic numbers' (e.g. 273.15) are repeated and would be more > readable as named numbers (e.g. c_to_k_factor : constant := 273.15;) Agreed in principle, but I don't think that 273.15 is a 'factor' precisely :-) We have just spent several minutes discussing a suitable name; one suggestion was on the lines of Zero_Celsius_In_Kelvins. procedure P (Temperature : Float); -- Temperature is in Kelvins C : Float; -- in Celsius ... P (Temperature => C + Zero_Celsius_In_Kelvins); which is pretty icky. Perhaps derived or even private types would be interesting. Perhaps just conversion functions, inline if you like? function To_Kelvins (Temperature_In_Celsius : Float) return Float; -- Simon Wright Email: simon.j.wright@amsjv.com Alenia Marconi Systems Voice: +44(0)23 9270 1778 Integrated Systems Division FAX: +44(0)23 9270 1800