comp.lang.ada
 help / color / mirror / Atom feed
From: Phil Clayton <phil.clayton@lineone.net>
Subject: Re: Gnat GPL 2010 available soon (conditional expressions)
Date: Mon, 5 Jul 2010 07:24:28 -0700 (PDT)
Date: 2010-07-05T07:24:28-07:00	[thread overview]
Message-ID: <c87fb0ed-f79e-400f-b98a-df3f8d7ca4c9@j4g2000yqh.googlegroups.com> (raw)
In-Reply-To: 4c31b341$0$6763$9b4e6d93@newsspool3.arcor-online.net

On Jul 5, 11:26 am, Georg Bauhaus <rm.dash-bauh...@futureapps.de>
wrote:
> On 05.07.10 03:27, Phil Clayton wrote:
>
> > On Jun 30, 4:21 am, Britt Snodgrass <britt.snodgr...@gmail.com> wrote:
> > For formal verification tools, conditional expressions could be
> > useful.  For example, there are two paths through
>
> >   if C then
> >     Y := A;
> >   else
> >     Y := B;
> >   end if;
>
> > but only one path through
>
> >   Y := (if C then A else B);
>
> Any advantage over a function---which in SPARK case will
> be a pure function, IIRC?
>
>   Y := Find_Y (Depends => 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
>
> >   (for I in 1 .. 5 => (for J in 1 .. 7 => (if I = J then 1.0 else
> > 0.0)))
>
> What kind of name would you pick for the thing?

I suppose I'd call it a 'tabulation'..

Phil



  reply	other threads:[~2010-07-05 14:24 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-16 20:14 Gnat GPL 2010 available soon Stephen Sangwine
2010-06-16 21:24 ` Martin
2010-06-16 21:35 ` Simon Wright
2010-06-18 19:48 ` Albrecht Käfer
2010-06-26 12:04   ` lekktu
2010-06-26 21:04     ` anon
2010-06-26 21:41       ` lekktu
2010-06-27  3:33         ` anon
2010-06-27 10:49           ` lekktu
2010-06-26 21:42     ` Dmitry A. Kazakov
2010-06-26 22:01       ` lekktu
2010-06-27  8:04       ` Gnat GPL 2010 available soon (conditional expressions) Georg Bauhaus
2010-06-27  8:37         ` Dmitry A. Kazakov
2010-06-27 10:55           ` lekktu
2010-06-27 12:12             ` Dmitry A. Kazakov
2010-06-27 13:42               ` Georg Bauhaus
2010-06-27 14:35                 ` Peter C. Chapin
2010-06-27 16:53                   ` Dmitry A. Kazakov
2010-06-28 11:24                     ` Peter C. Chapin
     [not found]                       ` <oizwym2afwmx.1jm5tt7wtpm7v.dlg@40tude.net>
2010-06-28 14:47                         ` Georg Bauhaus
2010-06-28 16:36                           ` Dmitry A. Kazakov
2010-06-28 17:04                             ` Georg Bauhaus
2010-06-28 17:37                               ` Dmitry A. Kazakov
2010-06-29 19:28                   ` Randy Brukardt
2010-06-30  1:19                     ` BrianG
2010-06-30  3:21                       ` Britt Snodgrass
2010-07-05  1:27                         ` Phil Clayton
2010-07-05 10:26                           ` Georg Bauhaus
2010-07-05 14:24                             ` Phil Clayton [this message]
2010-07-05 13:12                           ` Dmitry A. Kazakov
2010-07-05 22:47                             ` Phil Clayton
2010-07-06  7:36                               ` Dmitry A. Kazakov
2010-07-06  9:13                                 ` Georg Bauhaus
2010-07-06 16:31                                 ` Phil Clayton
2010-07-06 17:18                                   ` Dmitry A. Kazakov
2010-07-07 12:00                                     ` Phil Clayton
2010-07-07 13:39                                       ` Dmitry A. Kazakov
2010-06-30  4:13                       ` Gautier write-only
2010-06-30 16:46                         ` Warren
2010-06-30  4:09                     ` Gautier write-only
2010-06-30 23:20                       ` Peter C. Chapin
2010-06-27 21:40 ` Gnat GPL 2010 available soon mahdert
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox