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!gandalf.srv.welterde.de!news.szaf.org!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 23:22:57 +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 bx3/LxnRJ0VTBAAK1s5VAA+7pHUGOiEriDQVwA+7ho5zRnspFK Cancel-Lock: sha1:An8ZL4OsaAe0FJX+Upg/5WPy6V8= 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:49806 Date: 2018-01-07T23:22:57+02:00 List-Id: On 18-01-07 14:05 , Dmitry A. Kazakov wrote: > On 2018-01-07 12:36, Niklas Holsti wrote: >> On 18-01-06 19:20 , Dmitry A. Kazakov wrote: > >>> 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. > > If you want to have mutually exclusive alternatives you need type > ranges. Ok, I understand you now, and yes, you are right, if you want to include, in the same (hypothetical) class-based "case" statement, related cases at different levels in the class hierarchy. But there is an alternative: use nested "case" statements, one per level. > If S is a descendant of T then in order to build a case you have > to spell choices like: > > when T..S'Parent => > when S'Class => > > X in T..S'Parent = X in T'Class and X not in S'Class and T in S'Class. Yes, but I think your formula has a mistake. You assume that S is a descendant of T, but the formula requires that T is in S'Class, which under your assumption happens only if S = T. Perhaps you meant "S in T'Class"? -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .