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: stopping a loop iteration without exiting it Date: Sun, 7 Jan 2018 13:36:29 +0200 Organization: Tidorum Ltd Message-ID: References: <81971548-23c9-4927-a6a8-6f0f1dba896b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net Cjhs6VBg1S81duy7xlqveg514jyxBKXFtpA3tdlpb0cm3Bw6h/ Cancel-Lock: sha1:IeRNVsWIssapp72LkLUUIb3WUIs= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: Xref: reader02.eternal-september.org comp.lang.ada:49799 Date: 2018-01-07T13:36:29+02:00 List-Id: On 18-01-06 19:20 , Dmitry A. Kazakov wrote: > On 2018-01-06 17:50, Niklas Holsti wrote: >> On 18-01-05 10:38 , Dmitry A. Kazakov wrote: >>> On 2018-01-05 00:08, Niklas Holsti wrote: >>>> On 18-01-04 23:17 , Dmitry A. Kazakov wrote: >>>> >> If we have >> >> type Root is tagged ... >> >> type T is new Root ... >> >> type U is new Root ... >> >> the T'Class and U'Class do not overlap. But if "U is new T ..." then >> they overlap. > > And what will be selected? The semantic of case is of mutually exclusive > choices, so that the order of the choices were irrelevant. Well, that was what I suggested, that the "case" would require all choices to be non-overlapping, and therefore mutually exclusive. Yes, in generics it would not always be possible to decide whether two formal types overlap, so either the "case" would be illegal there, or it could be defined as a non-deterministic choice. > ... But that would require type ranges (see below) to resolve clashes [snip] > T is a single type. T'Class is a range of types similar to > 5..Integer'Last. Certainly definite ranges of types must be supported as > well: > > X in T..S > > which same as > > X in T'Class and T in S'Class and (X in S or else X not in S'Class) That is a bit hard to understand. Are you mixing into this condition both a definition of when T..S would be a legal "type range", and a definition of the membership test, X in T..S? Please clarify. > But the point is that it is the type of X not its value as it appears > when reading "case X is". For class-wide types, the "type of X" (i.e. the tag of X) is part of the value of X, IMO. But I would not mind if the syntax would require "case X'Tag is". However, I do think there is a clear (and perhaps valuable) difference between the forms when Same_X : T => where the object Same_X would not be class-wide, and when Same_X : U'Class => where the object Same_X would be class-wide. One could admit both kinds of "when" in the same "case", of course, as long and they are non-overlapping. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .