comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: When a conditional expression is static, where can it be used?
Date: Wed, 30 Jun 2010 07:39:24 -0700 (PDT)
Date: 2010-06-30T07:39:24-07:00	[thread overview]
Message-ID: <555e3a37-c709-4b9b-995a-907da862d4b7@m40g2000prc.googlegroups.com> (raw)
In-Reply-To: 4c2b1ecb$0$7670$9b4e6d93@newsspool1.arcor-online.net

On Jun 30, 3:39 am, Georg Bauhaus <rm.dash-bauh...@futureapps.de>
wrote:
> A totally meaningless example just to illustrate
> the question:  What is it that a compiler must report
> for the case statement below, if anything?

The choice "Sa" is not covered by any alternative.  Other than that, I
don't think there's anything wrong with the CASE statement, and if you
had included a "when others =>" alternative I think it would be
legal.  I'm not sure what potential problem you were trying to
illustrate.

                   -- Adam

>
> procedure CE is
>
>    type DOW is (Mo, Tu, We, Th, Fr, Sa, So);
>
>    procedure P is begin null; end P;
>
>    D: constant DOW := We;
> begin
>    case D is
>       when Mo | We | Fr => P;
>       when (if D = We or D = Fr then So else Sa) => P;
>       when Tu | Th  => P;
>    end case;
> end CE;
>
> Georg




  parent reply	other threads:[~2010-06-30 14:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-30 10:39 When a conditional expression is static, where can it be used? Georg Bauhaus
2010-06-30 11:25 ` Pascal Obry
2010-06-30 14:39 ` Adam Beneschan [this message]
2010-06-30 17:35   ` Dmitry A. Kazakov
2010-06-30 19:12     ` Adam Beneschan
2010-06-30 20:00       ` Dmitry A. Kazakov
2010-06-30 20:16         ` Adam Beneschan
2010-07-01 17:04       ` Pascal Obry
2010-06-30 20:05     ` Georg Bauhaus
2010-06-30 20:29       ` Adam Beneschan
2010-06-30 20:45       ` 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