comp.lang.ada
 help / color / mirror / Atom feed
From: Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
Subject: Re: issue with implementing a visitor design pattern
Date: Tue, 27 Jan 2004 09:36:20 +0100
Date: 2004-01-27T09:36:20+01:00	[thread overview]
Message-ID: <c18c10pbb7edaj178snc54pfogna2ntt59@4ax.com> (raw)
In-Reply-To: wccllnubh0e.fsf@shell01.TheWorld.com

On 26 Jan 2004 15:18:41 -0500, Robert A Duff
<bobduff@shell01.TheWorld.com> wrote:

>Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> writes:
>
>> On 24 Jan 2004 16:44:02 -0500, Robert A Duff
>> <bobduff@shell01.TheWorld.com> wrote:
>> 
>> >Dale Stanbrough <MrNoSpam@bigpoop.net.au> writes:
>> >
>> >> Robert A Duff wrote:
>> 
>> >Adding "case on 'Tag" to Ada would not be trivial.  One would have to
>> >reconcile the open-ended type extension capability of tagged types with
>> >the full-coverage rules of case statements.
>> 
>> Same as with integer types, an obligatory:
>> 
>>    when others =>
>>       ...
>
>"when others" *defeats* the full-coverage rules.  It should be used only
>if you know it covers *all* the other cases, including the ones that
>haven't been invented yet!

It is a strange thing, "when others". Especially when others (:-)) is
empty, like in:

subtype Empty is String (0..-1);
X : Empty := (others => ' ');

--
Regards,
Dmitry A. Kazakov
www.dmitry-kazakov.de



  reply	other threads:[~2004-01-27  8:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-15 19:22 issue with implementing a visitor design pattern cl1
2004-01-17  3:41 ` Robert I. Eachus
2004-01-17 21:24   ` Robert A Duff
2004-01-24 20:38     ` Dale Stanbrough
2004-01-24 21:44       ` Robert A Duff
2004-01-26  8:34         ` Dmitry A. Kazakov
2004-01-26 20:18           ` Robert A Duff
2004-01-27  8:36             ` Dmitry A. Kazakov [this message]
2004-02-01  0:32               ` Georg Bauhaus
2004-01-17 23:05   ` cl1
replies disabled

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