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,334f9012742e58fc X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!j4g2000yqh.googlegroups.com!not-for-mail From: Phil Clayton Newsgroups: comp.lang.ada Subject: Re: Gnat GPL 2010 available soon (conditional expressions) Date: Mon, 5 Jul 2010 07:24:28 -0700 (PDT) Organization: http://groups.google.com Message-ID: 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> <7ec98a71-edcb-4851-87fd-6702fb963829@q12g2000yqj.googlegroups.com> <4c31b341$0$6763$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Host: 91.110.199.193 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1278339868 31631 127.0.0.1 (5 Jul 2010 14:24:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 5 Jul 2010 14:24:28 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j4g2000yqh.googlegroups.com; posting-host=91.110.199.193; posting-account=v7gx3AoAAABfjb9m5b7l_Lt2KVEgQBIe User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.0.15) Gecko/2009102704 Fedora/3.0.15-1.fc10 Firefox/3.0.15,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:13161 Date: 2010-07-05T07:24:28-07:00 List-Id: On Jul 5, 11:26=A0am, Georg Bauhaus wrote: > On 05.07.10 03:27, Phil Clayton wrote: > > > On Jun 30, 4:21 am, Britt Snodgrass wrote: > > For formal verification tools, conditional expressions could be > > useful. =A0For example, there are two paths through > > > =A0 if C then > > =A0 =A0 Y :=3D A; > > =A0 else > > =A0 =A0 Y :=3D B; > > =A0 end if; > > > but only one path through > > > =A0 Y :=3D (if C then A else B); > > Any advantage over a function---which in SPARK case will > be a pure function, IIRC? > > =A0 Y :=3D Find_Y (Depends =3D> C); Not much advantage over a function, only that you don't have the overheads of introducing the new function and ensuring its specification has sufficient information. I wasn't really considering the possibility of introducing new functions as a general alternative. For example, I would rather see certain conditional expressions inline and not tucked away inside functions, for readability. (Correct, SPARK does not allow functions to have side effects.) > > In my view, condition expressions are a step in the right direction... > > but I'm the sort of person who wants to write an array aggregate like > > > =A0 (for I in 1 .. 5 =3D> (for J in 1 .. 7 =3D> (if I =3D J then 1.0 el= se > > 0.0))) > > What kind of name would you pick for the thing? I suppose I'd call it a 'tabulation'.. Phil