comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Ada2012 : When to use expression functions rather than function bodies?
Date: Fri, 16 Dec 2011 14:52:01 -0800 (PST)
Date: 2011-12-16T14:52:01-08:00	[thread overview]
Message-ID: <12acbf57-01fc-43dd-8881-d39c2a63146b@q9g2000yqe.googlegroups.com> (raw)
In-Reply-To: jcgf35$10t$1@adenine.netfront.net

On Dec 16, 2:01 pm, Jeffrey Carter
<spam.jrcarter....@spam.not.acm.org> wrote:
> On 12/16/2011 05:25 AM, Martin wrote:
>
> > Are there any good arguments for *not* replacing all simple, single
> > line functions that don't [directly] access package body state
> > information with expression functions?
>
> Are there any good arguments for expression functions?

Quote from AI05-0177-1 (http://www.ada-auth.org/cgi-bin/cvsweb.cgi/
ai05s/ai05-0177-1.txt?rev=1.13):

With the advent of pre and postconditions (see AI05-0145-1), and
conditional expressions (see AI05-0147-1), expressions in
specifications are going to grow much larger and become more
complicated. It is important that parts of such expressions can be
abstracted.
Abstraction of expressions is usually done by introducing functions.
However, this puts the expression in the body, rather than the
specification. This has several negative side-effects:
-- Hiding of the expression from the compiler and other tools that
primarily process specifications;
-- Requiring the body to exist in order to do static analysis of the
pre/post conditions (meaning static analysis cannot be performed early
in the development of a system or on the use of skelton [sic]
placeholder packages).
-- Introduction of otherwise unnecessary bodies and/or otherwise
unnecessary
inline body dependencies (increasing system build times).

Apparently the ARG thought this was a good argument.  I'm not
endorsing it personally -- I don't have a particular opinion -- but it
appears sensible on its face.

                             -- Adam



  reply	other threads:[~2011-12-16 22:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-16 12:25 Ada2012 : When to use expression functions rather than function bodies? Martin
2011-12-16 13:24 ` Dmitry A. Kazakov
2011-12-17  1:03   ` Randy Brukardt
2011-12-16 18:03 ` Adam Beneschan
2011-12-16 20:36   ` Martin Dowie
2011-12-16 21:34     ` Adam Beneschan
2011-12-16 23:08       ` Adam Beneschan
2011-12-17 12:26   ` georg bauhaus
2011-12-16 22:01 ` Jeffrey Carter
2011-12-16 22:52   ` Adam Beneschan [this message]
2011-12-16 23:09     ` Adam Beneschan
2011-12-17  1:21     ` Randy Brukardt
2011-12-17 12:45       ` georg bauhaus
2011-12-17 13:11         ` Dmitry A. Kazakov
2011-12-19 23:34           ` Randy Brukardt
replies disabled

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