functions must act as pure functions
Functions defined in pugs
are mean to be mathematical functions.
These are pure functions: no data should change during function application.
That is
-
parameters are unchanged -
used global data are constant -
called C-functions
, such ascmath
functions for instant, must not modify arguments (C-function
arguments must beconst
.
These three rules are not ensured by now, which does not correspond to the definition of these functions. Moreover violating these constrains can lead to unexpected behavior or even more to undefined behavior.
Edited by Stéphane Del Pino