comp.lang.ada
 help / color / mirror / Atom feed
From: georg bauhaus <rmhost.bauhaus@maps.arcor.de>
Subject: Re: Ada2012 : When to use expression functions rather than function bodies?
Date: 17 Dec 2011 12:26:21 GMT
Date: 2011-12-17T13:26:21+01:00	[thread overview]
Message-ID: <352782378345816751.836638rmhost.bauhaus-maps.arcor.de@news.arcor.de> (raw)
In-Reply-To: d7d3a1b3-5aa7-4f19-975b-1e10b4386b82@p16g2000yqd.googlegroups.com

Adam Beneschan <adam@irvine.com> wrote:
.
> 
> In most cases, it's probably OK to replace a function specification in
> the *private* part of a package with an expression function if the
> body is simple.  But the encapsulation argument could still apply if
> the function is intended to be usable by child packages.


A pragma Pure is, I think, helpful when
writing expression functions in particular
if it forces thinking about the kind of
functions one is writing: expression functions that
have effects other than computing 
the result value seem out of (some) style.



  parent reply	other threads:[~2011-12-17 12:26 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 [this message]
2011-12-16 22:01 ` Jeffrey Carter
2011-12-16 22:52   ` Adam Beneschan
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