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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a00006d3c4735d70 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-07 05:33:39 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!tar-atanamir.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Certified C compilers for safety-critical embedded systems Date: Wed, 07 Jan 2004 14:39:54 +0100 Message-ID: References: <3ff0687f.528387944@News.CIS.DFN.DE><1086072.fFeiH4ICbz@linux1.krischik.com><3ff18d4d.603356952@News.CIS.DFN.DE><1731094.1f7Irsyk1h@linux1.krischik.com><3ff1b8ef.614528516@News.CIS.DFN.DE> <3FF1E06D.A351CCB4@yahoo.com><3ff20cc8.635997032@News.CIS.DFN.DE><3ff9df16.30249104@News.CIS.DFN.DE> <3FFC0201.6020303@noplace.com> NNTP-Posting-Host: tar-atanamir.cbb-automation.de (212.79.194.116) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1073482417 7265150 212.79.194.116 ([77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:4171 Date: 2004-01-07T14:39:54+01:00 List-Id: On Wed, 07 Jan 2004 12:56:36 GMT, Marin David Condic wrote: >What exactly would be the meaning of: > >A := Func_X (A) + Func_Y (A) ; > >if functions had in-out parameters and A could be modified while >evaluating the RHS? I suppose one might be able to come up with some >evaluation rules that at least meant determinism for the end result, but >staring at it would not make it intuitively obvious to even the most >casual observer. Sure, the functions *could* modify A if they had >visibility to the right scope, but how often does someone do that in >real-world use? The current style - while not guaranteeing a lack of >side effects - tends to discourage it and leads to more easily >comprehended code. > >I don't understand what the headache is here anyway. If one wants to >modify parameters, use a procedure. If one wants some kind of >math-oriented thingie to return a result, use a function. The headache is: declare X : Y'Class := ; Z : String := ; One wants: A. to have an ability to return objects of unconstrained types B. in design, to avoid side-effects not manifested by the parameters C. in design, to avoid unnecessary use of pointers A+B+C is that too much? [ In any of the possible evaluation orders? I have an impression that some people would agree with A, B, C, but not with A+B+C (:-)) ] -- Regards, Dmitry A. Kazakov www.dmitry-kazakov.de