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 X-Received: by 10.98.44.215 with SMTP id s206mr7364101pfs.5.1461191198072; Wed, 20 Apr 2016 15:26:38 -0700 (PDT) X-Received: by 10.182.124.9 with SMTP id me9mr151684obb.12.1461191198030; Wed, 20 Apr 2016 15:26:38 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!g8no4944999igr.0!news-out.google.com!u9ni267igk.0!nntp.google.com!g8no4944998igr.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 20 Apr 2016 15:26:37 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=94.174.195.8; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G NNTP-Posting-Host: 94.174.195.8 References: <1mlx1gf.ebrae11jak5tyN%csampson@inetworld.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: if-then-no-else Programming From: Martin Injection-Date: Wed, 20 Apr 2016 22:26:38 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:30211 Date: 2016-04-20T15:26:37-07:00 List-Id: On Tuesday, April 19, 2016 at 1:17:18 PM UTC+1, G.B. wrote: [snip] > Ada 2012 adds conditional expressions (in addition to the > old nested functions that need to return). So, if the value > that is to be assigned depends on Condition, > > Variable := > (if Condition > then 1 > else 3); > > is another way of making sure that Variable is initialized, > in *one* statement! [snip] I *much* prefer this style as the post-condition can't be accidentally missed (the post-condition being that 'Variable' is assigned a value). Leave 'if' statements for doing genuinely different responses. -- Martin