comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: "unconstrained subtype in component declaration" vs "discriminant in constraint must appear alone"
Date: Mon, 22 Feb 2021 11:57:43 +0100	[thread overview]
Message-ID: <s102n5$1ckg$1@gioia.aioe.org> (raw)
In-Reply-To: 67ea71d9-489a-4802-9cf0-d955f6ecce62n@googlegroups.com

On 2021-02-22 11:14, AdaMagica wrote:
> J-P. Rosen schrieb am Montag, 22. Februar 2021 um 07:32:27 UTC+1:
>> 3) Sets_of_Card (0..nb-1)
>> Yes, you cannot make computations
>> in a discriminant constraint. Although this may seem sometimes
>> frustrating to the user, it was required for implementation reasons.
> 
> Remeber, a discriminant is a record component like the others, so it covers some bits.
> If it were allowed to be used in expressions, either each result would need a storage place of its own or a reevaluation at every use of the object.

Yes, though if the implementation would dope all indefinite 
representations, not just arrays, then keeping some more things in the 
dope or evaluating them would not be a big issue.

The ultimate goal is, of course, removing the dope if static. Be it 
array bounds, discriminants or type tag.

P.S. Composition of a dope from the dopes of the components is basically 
the same problem as full multiple inheritance. If the language had one 
it could have both.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2021-02-22 10:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22  0:14 "unconstrained subtype in component declaration" vs "discriminant in constraint must appear alone" Mehdi Saada
2021-02-22  6:32 ` J-P. Rosen
2021-02-22 10:14   ` AdaMagica
2021-02-22 10:57     ` Dmitry A. Kazakov [this message]
2021-02-22 14:20       ` Mehdi Saada
2021-02-22 15:11         ` J-P. Rosen
2021-02-22 15:55         ` Dmitry A. Kazakov
2021-02-22 16:21           ` Mehdi Saada
2021-02-23 22:06             ` Mehdi Saada
2021-02-24  9:59               ` AdaMagica
2021-02-24 10:04               ` Jeffrey R. Carter
2021-02-24 14:11               ` Simon Wright
2021-02-24 15:57               ` Shark8
2021-02-25  0:13                 ` Mehdi Saada
2021-02-25  8:58                   ` AdaMagica
2021-02-25 10:25                     ` Mehdi Saada
2021-02-25 10:28                     ` Mehdi Saada
2021-02-22 10:35 ` Jeffrey R. Carter
2021-02-22 14:21   ` Mehdi Saada
2021-02-22 15:02     ` Jeffrey R. Carter
2021-02-22 15:08       ` J-P. Rosen
replies disabled

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