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,ca038f7e5f1aa1b9 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Arithmetic with durations Date: 1997/09/11 Message-ID: #1/1 X-Deja-AN: 271781275 References: <873869111.49snx@jvdsys.nextjk.stuyts.nl> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-09-11T00:00:00+00:00 List-Id: : In article <34149060.2E21@home.com> lmcoon@home.com writes: : >The line that calculates the amount of simulation : >time to wait for each event won't compile. My : >compiler (Thomson ObjectAda running in Windows 95) : >produces the following diagnostic: "LRM:4.5.5(20) : >The fixed-fixed multiplying operators shall not be : >used in a context where the expected type for the : >result is universal_fixed." This is a nice example of why RM references are not as helpful as people think they might be. Here is the GNAT diagnostic for this particular case: 1. procedure z is 2. type m is delta 0.1 range 0.0 .. 1.0; 3. a,b,c,d : m; 4. 5. begin 6. a := b * c * d; | >>> type cannot be determined from context >>> explicit conversion to result type required 7. end; which I think has a much better chance of prompting someone to figure out the solution on their own!