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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9f99a33281d5072c X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!b33g2000prd.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: When a conditional expression is static, where can it be used? Date: Wed, 30 Jun 2010 13:29:10 -0700 (PDT) Organization: http://groups.google.com Message-ID: <740ab66d-69b6-4d32-817a-bde88b4cd873@b33g2000prd.googlegroups.com> References: <4c2b1ecb$0$7670$9b4e6d93@newsspool1.arcor-online.net> <555e3a37-c709-4b9b-995a-907da862d4b7@m40g2000prc.googlegroups.com> <12ok8wnj6k4sw$.ravumwbhfb1h$.dlg@40tude.net> <4c2ba385$0$6772$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1277929750 13945 127.0.0.1 (30 Jun 2010 20:29:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 30 Jun 2010 20:29:10 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b33g2000prd.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:12057 Date: 2010-06-30T13:29:10-07:00 List-Id: On Jun 30, 1:05=A0pm, Georg Bauhaus wrote: > >> The choice "Sa" is not covered by any alternative. =A0Other than that,= I > >> don't think there's anything wrong with the CASE statement, and if you > >> had included a "when others =3D>" alternative I think it would be > >> legal. =A0I'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? =A0Yes, 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