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!news.unit0.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: syntaxic exploration Date: Mon, 25 Dec 2017 20:27:25 +0200 Organization: Tidorum Ltd Message-ID: References: <0d33e631-e63d-4346-ac95-5eec72127f4f@googlegroups.com> <0fa75dd5-599b-4a38-a5d4-3151bbe5172f@googlegroups.com> <7c026086-1eee-4c65-9972-6d1f99a709ae@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net KKkO7Q8oQPSyU/PUxAcCVQ1iuD8EpYkN0dS0da2zhIRe6iGqSm Cancel-Lock: sha1:ohuGirSi9PU9NB1kwodigwu+34Q= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: <7c026086-1eee-4c65-9972-6d1f99a709ae@googlegroups.com> Xref: reader02.eternal-september.org comp.lang.ada:49639 Date: 2017-12-25T20:27:25+02:00 List-Id: On 17-12-25 16:42 , Mehdi Saada wrote: > More importantly, why would anyone use an enumeration > type with only one value ? I don't get it. It's a limit case that comes up fairly often when one creates generic software components parametrized by enumeration types, or other discrete types. (Sometimes one would like to use such a component with an enumeration type that has _no_ elements, but that seldom works...) Null record types (with no components) and empty arrays are similar limit cases. The number zero and the empty set are others. It is important that language has sensible and consistent rules for these limits (for example, a loop over an empty array should execute the loop body zero times) so that generic code can be written without always handling these limit cases separately. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .