comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: stopping a loop iteration without exiting it
Date: Sun, 7 Jan 2018 13:36:29 +0200
Date: 2018-01-07T13:36:29+02:00	[thread overview]
Message-ID: <fbef1uF9clvU1@mid.individual.net> (raw)
In-Reply-To: <p2r0h8$9qr$1@gioia.aioe.org>

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
       .      @       .


  reply	other threads:[~2018-01-07 11:36 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-03 16:54 stopping a loop iteration without exiting it Mehdi Saada
2018-01-03 17:23 ` Lucretia
2018-01-03 21:19   ` Randy Brukardt
2018-01-03 23:17     ` Robert A Duff
2018-01-04  8:47       ` Niklas Holsti
2018-01-05  1:31         ` Randy Brukardt
2018-01-04 10:08       ` Jeffrey R. Carter
2018-01-04 11:02         ` Dmitry A. Kazakov
2018-01-04 19:46           ` Robert A Duff
2018-01-04 20:47             ` Mehdi Saada
2018-01-04 21:17             ` Dmitry A. Kazakov
2018-01-04 23:08               ` Niklas Holsti
2018-01-05  8:38                 ` Dmitry A. Kazakov
2018-01-06 16:50                   ` Niklas Holsti
2018-01-06 17:20                     ` Dmitry A. Kazakov
2018-01-07 11:36                       ` Niklas Holsti [this message]
2018-01-07 12:05                         ` Dmitry A. Kazakov
2018-01-07 21:22                           ` Niklas Holsti
2018-01-08  8:35                             ` Dmitry A. Kazakov
2018-01-08 20:57                       ` Randy Brukardt
2018-01-08 21:19                         ` Dmitry A. Kazakov
2018-01-08 21:48                           ` Submitting requests to the ARG, was: " Simon Clubley
2018-01-09  9:45                             ` Dmitry A. Kazakov
2018-01-08 22:35                         ` Jeffrey R. Carter
2018-01-05 16:34               ` Robert A Duff
2018-01-05 19:09                 ` G. B.
2018-01-07 11:52               ` Niklas Holsti
2018-01-07 12:27                 ` Dmitry A. Kazakov
2018-01-06  0:53           ` Keith Thompson
2018-01-06  8:36             ` Dmitry A. Kazakov
2018-01-06  8:49               ` gautier_niouzes
2018-01-06  9:26                 ` Dmitry A. Kazakov
2018-01-08 11:05                 ` mockturtle
2018-01-09 11:05               ` AdaMagica
2018-01-09 11:26                 ` Dmitry A. Kazakov
2018-01-09 12:50                   ` Simon Wright
2018-01-09 13:07                     ` Dmitry A. Kazakov
2018-01-09 13:47                       ` Dennis Lee Bieber
2018-01-09 14:53                         ` Dmitry A. Kazakov
2018-01-09 20:07                           ` G. B.
2018-01-10  8:13                             ` Dmitry A. Kazakov
2018-01-10 21:14                               ` G. B.
2018-01-11 12:48                                 ` AdaMagica
2018-01-11 20:54                                   ` G. B.
2018-01-11 13:06                                 ` Dmitry A. Kazakov
2018-01-11 17:11                                   ` Simon Wright
2018-01-11 17:30                                     ` Dmitry A. Kazakov
2018-01-11 18:09                                       ` Simon Wright
2018-01-11 20:54                                   ` G. B.
2018-01-12  8:20                                     ` Dmitry A. Kazakov
2018-01-12  9:22                                       ` G. B.
2018-01-12  9:42                                         ` Dmitry A. Kazakov
2018-01-10 10:52                       ` AdaMagica
2018-01-10 11:14                         ` Dmitry A. Kazakov
2018-01-10 11:21                           ` AdaMagica
2018-01-10 13:47                             ` Dmitry A. Kazakov
2018-01-04 21:52         ` Mart van de Wege
2018-01-05 13:17           ` Jeffrey R. Carter
2018-01-05 14:35             ` Mart van de Wege
2018-01-05 15:21               ` Jeffrey R. Carter
2018-01-05 19:13                 ` Paul Rubin
2018-01-05 23:50                   ` Randy Brukardt
2018-01-06  1:19                   ` G. B.
2018-01-06  9:59                   ` Jeffrey R. Carter
2018-01-05  1:17         ` Randy Brukardt
2018-01-05 14:05           ` Jeffrey R. Carter
2018-01-05 23:58             ` Randy Brukardt
2018-01-04 12:43     ` gautier_niouzes
2018-01-03 17:28 ` Jeffrey R. Carter
2018-01-03 18:27 ` Mehdi Saada
2018-01-06  0:26 ` Matt Borchers
2018-01-06 22:04   ` J-P. Rosen
2018-01-07  2:05     ` Matt Borchers
2018-01-08 20:49   ` Randy Brukardt
2018-01-07 11:33 ` Mehdi Saada
2018-01-07 11:45   ` Simon Wright
2018-01-08  0:58   ` Matt Borchers
2018-01-07 17:47 ` Micah Waddoups
2018-01-07 21:04   ` Simon Wright
2018-01-23  3:49 ` Robert Eachus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox