Re: pure procedure



On 04/22/2011 08:56 PM, Richard Maine wrote:
<nmm1@xxxxxxxxx> wrote:

Well, yes, but that's not the REAL gain, which is how much they
can speed up debugging in large programs. If you see a PURE
procedure, (a) you can be certain that it isn't going to have a
strange (legal or illegal) side-effect on some other data and
(b) you can put extra calls in your diagnostic statements without
affecting the results.

Of course, lying to the compiler and tricking it into believing your
lies, as the OP was suggesting, completely defeats that object.


Indeed. Nobody forces you to use pure procedures. If you use them, presumably it's because you *want* the assurance of a side-effect free procedure.

Daniel.

.



Relevant Pages

  • Re: pure procedure
    ... can speed up debugging in large programs. ... If you see a PURE ... lying to the compiler and tricking it into believing your ... lies, as the OP was suggesting, completely defeats that object. ...
    (comp.lang.fortran)
  • Re: pure procedure
    ... output possible from PURE procedures. ... It *does* make debugging more difficult. ... But as I've said earlier, there are reasons why printing is prohibited, this is not just a random idea that the Fortran committee just had. ...
    (comp.lang.fortran)
  • Re: pure procedure
    ... On 04/23/2011 01:33 PM, Aris wrote: ... output possible from PURE procedures. ... because I use pure and elemental procedures everywhere in ... It *does* make debugging more difficult. ...
    (comp.lang.fortran)
  • Re: pure procedure
    ... Daniel Carrera wrote: ... output possible from PURE procedures. ... It *does* make debugging more difficult. ...
    (comp.lang.fortran)