comp.lang.ada
 help / color / mirror / Atom feed
From: Vinzent Hoefler <ada.rocks@jlfencey.com>
Subject: Re: Interesting effects in array renaming
Date: Thu, 26 Jun 2003 15:01:19 +0200
Date: 2003-06-26T15:01:19+02:00	[thread overview]
Message-ID: <bdequ3$sie29$1@ID-175126.news.dfncis.de> (raw)
In-Reply-To: bdeps6$qd1$1@a1-hrz.uni-duisburg.de

Georg Bauhaus wrote:

>Vinzent Hoefler <ada.rocks@jlfencey.com> wrote:
>: Randy Brukardt wrote:
>: 
>:>But there are a number of things about Ada that are wrong (the inability
>:>to use "in out" parameters on functions is the most obvious to me),
>: 
>: In fact the idea that a function shall have no (or at least very
>                       pure
>: limited) side effects is a quite good one.
>
>Image the name of the beast wasn't function.

Well, I was thinking of VHDL and there exists the concept of pure and
impure functions. "pure" says, regardless of what happens, this
function will *always* return the same value for the same parameter
set with which it is called, but the "impure" function might read some
signal, so its return value might be different from the previous even
when called with the same parameters.

So i.e. SPARK's functions that should be free of side effects, are
really the equivalent to VHDL's _im_pure function like this one:

|impure function Check_Signal (Signal : Std_Logic) return Std_Logic is
|begin
|   return Global_State xor Signal;
|end Check_Signal;

So, no. A pure function (in a more mathematical sense) was not what I
was talking about.
Impure functions look ok for me, but they still shouldn't be able to
change their parameters or (more generally) the state of the system.


Vinzent.

-- 
Parents strongly cautioned  --  this  posting  is  intended for mature
audiences  over  18.  It  may  contain some material that many parents
would not find suitable for children and may include intense violence,
sexual situations, coarse language and suggestive dialogue.



      reply	other threads:[~2003-06-26 13:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-22 14:52 Interesting effects in array renaming Dmitry A. Kazakov
2003-06-22 17:24 ` Jeffrey Carter
2003-06-23  8:12   ` Dmitry A. Kazakov
2003-06-23 10:29     ` Georg Bauhaus
2003-06-23 11:37       ` Dmitry A. Kazakov
2003-06-23 13:28         ` Georg Bauhaus
2003-06-24  7:35           ` Dmitry A. Kazakov
2003-06-24 14:38             ` Georg Bauhaus
2003-06-25 10:28               ` Dmitry A. Kazakov
2003-06-25 14:23                 ` Georg Bauhaus
2003-06-25 19:00                   ` Dmitry A. Kazakov
2003-06-24  2:35     ` Robert I. Eachus
2003-06-24  7:35       ` Dmitry A. Kazakov
2003-06-24 10:08         ` Lutz Donnerhacke
2003-06-24 11:53         ` Georg Bauhaus
2003-06-24 12:48           ` Dmitry A. Kazakov
2003-06-26  2:54             ` Randy Brukardt
2003-06-26  6:27               ` Vinzent Hoefler
2003-06-26 12:44                 ` Georg Bauhaus
2003-06-26 13:01                   ` Vinzent Hoefler [this message]
replies disabled

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