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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: Community Input for the Maintenance and Revision of the Ada Programming Language Date: Mon, 2 Oct 2017 17:02:13 +0200 Organization: A noiseless patient Spider Message-ID: References: <325cf1db-bd9e-4f58-a07b-f297960df269@googlegroups.com> Reply-To: nonlegitur@notmyhomepage.de Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 2 Oct 2017 15:02:14 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="5f318c96f7e93e70f784006930e0b8dd"; logging-data="18519"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18XNa8uC0x/sSV26etGCb1UUF7PLEvsqQA=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: <325cf1db-bd9e-4f58-a07b-f297960df269@googlegroups.com> Cancel-Lock: sha1:W5wz3GGBKGUrbySJjC1AwFTFXGU= Xref: news.eternal-september.org comp.lang.ada:48276 Date: 2017-10-02T17:02:13+02:00 List-Id: On 02.10.17 12:06, reinert wrote: > Not a big issue, but why does not this function: > > if t1 < Clock and Clock < t2 then ... > > Should it? The compiler should accept because the line means if "<" (clock, t1) and "<" (clock, t2) then ... and "<" is defined for Time values. But the order of evaluation is not determined when writing the expression in the above way. First, "and" is different from "and then". This should matter when calling Clock if real time is intrinsically sequential. Second, consider reasons why in SPARK Ada you'll be asked to always store the result of Clock into a variable (or constant) by assignment and then use that variable. > if Clock in t1 .. t2 then -- this dows *not* function 14. if Clock in t1 .. t2 then -- this dows *not* function | >>> scalar type required for range This does not work because Time is not a scalar type, even though time per se, if measured in seconds, say, can make one think it is of a scalar type. But type Time is private, in Ada, an abstract point in time, not a number of time units.