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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,334f9012742e58fc X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!news.netcologne.de!newsfeed-fusi2.netcologne.de!feeder.erje.net!newsfeed.velia.net!noris.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Gnat GPL 2010 available soon (conditional expressions) Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <2010061621145016807-sjs@essexacuk> <0fa4c574-9539-492f-8514-d32c68beb22a@w31g2000yqb.googlegroups.com> <1frrgtpa5dycl$.12kl72iqsg3dx$.dlg@40tude.net> <4c270613$0$6974$9b4e6d93@newsspool4.arcor-online.net> <1wuwvzgwlwgli$.1birkinieia0d$.dlg@40tude.net> <1ur19ais2ejih.mjbgdsv9pr66.dlg@40tude.net> <4c275562$0$6987$9b4e6d93@newsspool4.arcor-online.net> <4c276114$0$2378$4d3efbfe@news.sover.net> Date: Sun, 27 Jun 2010 18:53:50 +0200 Message-ID: <4rdrvu1jskwp.1aomtio1yk12o.dlg@40tude.net> NNTP-Posting-Date: 27 Jun 2010 18:53:49 CEST NNTP-Posting-Host: a1a6018a.newsspool4.arcor-online.net X-Trace: DXC=`c@YKPB@aBH[6=1B@oB@@@4IUK On Sun, 27 Jun 2010 10:35:02 -0400, Peter C. Chapin wrote: > Also I find that when skimming program text just knowing that something > is conditional is sometimes enough for me to decide if I have to read it > more closely or not. If it says > > X := (if Rare_Condition then > Complicated_Expression > else > Complicated_Expression); In comparable cases earlier Ada's choices were opposite: Complicated_Expression and then Complicated_Expression Complicated_Expression or else Complicated_Expression (Type with Complicated_List) > I might be able to quickly tell which complicated expression I need to > look at without having to study both. Do not use complicated expressions, that is the point! Note that you have to format the expression so that it looked like a normal if. What is the gain? It is unreadable when written as one line. It is as verbose as normal if when formatted. And it does not save you writing a function in real-life cases: File_Name := Argument (1); > Of course it all comes down to what one is used to. Dmitry says the > leading 'if' makes things harder to read, but I find his examples much > more difficult. If you like prefix notation, then why not: generic -- Built-in intrinsic generic for each type Type (<>) is limited private; function "if" (Condition : Boolean; Then, Else : Type) return Type; used as: if (A, B, C) if (A, then => B, else => C) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de