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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!fx12.iad.POSTED!not-for-mail From: Shark8 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:32.0) Gecko/20100101 Thunderbird/32.0a1 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Style Question: normal record vs discriminated null-record. References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Complaints-To: abuse@teranews.com NNTP-Posting-Date: Tue, 03 Jun 2014 06:20:09 UTC Organization: TeraNews.com Date: Tue, 03 Jun 2014 00:20:04 -0600 X-Received-Bytes: 1822 X-Received-Body-CRC: 2146442578 Xref: news.eternal-september.org comp.lang.ada:20121 Date: 2014-06-03T00:20:04-06:00 List-Id: 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.