[Next] [Up] [Previous]


The MATHEMATICAL statement has the form

       MATHEMATICAL name,name2...

and declares that the functions (or subroutines) named are not intended to, and are not to be permitted to, change any of their arguments, and that furthermore the compiler should accept on faith, in the case of functions only, that they do not do anything but return a value.

Thus, the statement


means that the computer can treat

       . Y=PQR(VVL(X),VVL(X))

as identical to

       . T00001=VVL(X)
       . Y=PQR(T00001,T00001)

which would be wrong if VVL were expected to make the user's terminal beep X times in addition to returning a numeric result.

This 'no side-effects' rule does not apply to subroutines declared MATHEMATICAL, since in that case such a subroutine could do nothing at all, so subsequent calls to a subroutine with the same arguments are not combined.

[Next] [Up] [Previous]