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!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Community Input for the Maintenance and Revision of the Ada Programming Language Date: Mon, 2 Oct 2017 18:38:01 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <325cf1db-bd9e-4f58-a07b-f297960df269@googlegroups.com> <457e2526-d4b6-4999-8521-64f8b6a0810f@googlegroups.com> NNTP-Posting-Host: MajGvm9MbNtGBKE7r8NgYA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 X-Notice: Filtered by postfilter v. 0.8.2 Content-Language: en-US Xref: news.eternal-september.org comp.lang.ada:48278 Date: 2017-10-02T18:38:01+02:00 List-Id: On 2017-10-02 18:23, reinert wrote: > On Monday, October 2, 2017 at 5:02:16 PM UTC+2, G.B. wrote: > ...... >> >> 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. > > I thought "x in a..b" was (should be?) short for "a <= x and x <= b" > (where x, a and b are elements in a (strict) linearly ordered set or so). Yes, but there is no Time interval type defined in Ada, alas. t1..t2 is an expression resulting in an interval. The right way, considering that Clock is not constant, is: Clock - t1 in 0..t2 - t1 then or, considering implied semantics, simply if Clock <= Deadline then or if Clock - Started_At <= Timeout then -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de