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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,af3dada69080e420 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-26 06:03:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!213.200.246.247!not-for-mail From: Vinzent Hoefler Newsgroups: comp.lang.ada Subject: Re: Interesting effects in array renaming Date: Thu, 26 Jun 2003 15:01:19 +0200 Organization: JeLlyFish software Message-ID: References: <3EF5E6B8.3030203@spam.com> <3EF7B8CC.3000100@attbi.com> Reply-To: v.hoefler@acm.org NNTP-Posting-Host: 213.200.246.247 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: fu-berlin.de 1056632579 29964361 213.200.246.247 (16 [175126]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:39773 Date: 2003-06-26T15:01:19+02:00 List-Id: Georg Bauhaus wrote: >Vinzent Hoefler wrote: >: Randy Brukardt wrote: >:=20 >:>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), >:=20 >: 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. --=20 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.