From: Shark8 <OneWingedShark@gmail.com>
Subject: Re: Style Question: normal record vs discriminated null-record.
Date: Tue, 03 Jun 2014 00:20:04 -0600
Date: 2014-06-03T00:20:04-06:00 [thread overview]
Message-ID: <tOdjv.78431$Mk4.49942@fx12.iad> (raw)
In-Reply-To: <lmjjge$1lf$1@dont-email.me>
On 02-Jun-14 22:38, J-P. Rosen wrote:
> Depends how you perceive your data. Discriminants are intended to define
> some kind of subclasses of your type, and can be used to parameterized
> inner components. Some criteria for you to chose:
>
> 1 - You can define subtypes according to certain values of discriminants.
>
> 2 - Discriminants are always initialized.
>
> 3 - Discriminants cannot be changed after the declaration.
Right -- the particular situation [alerts] seems like a good fit because
of these qualities:
(1) Subtypes for critical failures can be defines and quick/clear
disambiguation/determination in handling [an unconstrained type] via 'in'.
(2) Which means, ideally that the point that generates the alert always
generates correctly.
(3) That they cannot be altered means that to 'change' the message is to
handle it and generate a new one -- kind of like "renaming"/re-raising
exceptions.
This is what makes it seem like a good fit, but I was still wondering
what "normal Ada programmers" thought about it.
next prev parent reply other threads:[~2014-06-03 6:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-03 2:44 Style Question: normal record vs discriminated null-record Shark8
2014-06-03 4:38 ` J-P. Rosen
2014-06-03 4:40 ` J-P. Rosen
2014-06-03 6:20 ` Shark8 [this message]
2014-06-03 7:19 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox