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!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Ada.Real_Time.Time_Last Date: Sat, 18 Nov 2017 15:18:40 +0200 Organization: Tidorum Ltd Message-ID: References: <591a9389-a4b8-43fa-b963-0ebb9e488be1@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net JCvHDBuJGP2jM+da1W2mQgh9uaFag/vDUNFH9+r9pH9lG4oyfU Cancel-Lock: sha1:Aq2lB0WELvzxwbmhyODhN4jtoqE= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: <591a9389-a4b8-43fa-b963-0ebb9e488be1@googlegroups.com> Xref: feeder.eternal-september.org comp.lang.ada:48987 Date: 2017-11-18T15:18:40+02:00 List-Id: On 17-11-18 15:06 , AdaMagica wrote: > Am Freitag, 17. November 2017 22:39:51 UTC+1 schrieb Niklas Holsti: > >> Long ago, I suggested (on c.l.a) an Ada extension by which a package >> could declare private types using the same classes of types that can be >> used for generic formal types. That would IMO not only be useful for >> programmers, it could formalise some of the informal text in the Ada RM. >> For example, RM A.4.8 defines the type Ada.Direct_IO.Count as >> >> type Count is range 0 .. implementation defined; >> >> With the suggested extension, this could be written in legal (extended) >> Ada as >> >> type Count is private range <>; >> >> That form still does not show that Count'First = 0, but with a little >> further extension one could perhaps leave only the upper bound >> unspecified, as in: >> >> type Count is private range 0 .. <>; >> >> Perhaps it is time for me to revive this proposal... >> > Problem with this is that private types have no predefined operators. That is a problem with private types in *current* Ada, where a private type is fully "opaque". This proposal is meant to remove this problem, by letting the programmer provide more information about the private type, in the same way as information can now be provided about generic formal types, to equip those types with predefined operators that can be used in the generic. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .