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 13:29:10 -0700 (PDT)
Date: 2010-06-30T13:29:10-07:00	[thread overview]
Message-ID: <740ab66d-69b6-4d32-817a-bde88b4cd873@b33g2000prd.googlegroups.com> (raw)
In-Reply-To: 4c2ba385$0$6772$9b4e6d93@newsspool3.arcor-online.net

On Jun 30, 1:05 pm, Georg Bauhaus <rm.dash-bauh...@futureapps.de>
wrote:

> >> 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.
>
> The questions I had asked myself (a little too quick, I suppose)
> were along these lines:
>
> Is it possible to invalidate a case construct by simply
> changing the value of a static constant used in determining
> conditional static case values?  Yes, it is possible even without
> conditional expressions, but do these introduce failures that
> are much more tricky to straighten out?

Of course, your case doesn't illustrate this; your case statement
could not have been valid for any possible value of D, so there's no
question of invalidating it by changing D.


> If parts of the language will have new (static) possibilities,
> what modes of (careful) thinking will these necessitate?

It means you have to be careful to write code that will be valid for
any possible value of the static constant(s) used in the conditional
expression.  But this hardly seems earth-shattering.  Nor do I expect
it would cause a problem in real life.  Sure, it's possible to create
code that will fail when a static value is changed and that might be
tricky to straighten out; but I suspect that this won't happen unless
a programmer was trying to be tricky in the first place.  Which I
don't recommend.  Write straightforward code and leave the tricks to
dog trainers.

                     -- Adam




  reply	other threads:[~2010-06-30 20:29 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
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 [this message]
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